使用Nginx做邮件代理服务器配置
2015-06-24 14:25
741 查看
在nginx.conf的文件末尾加入mail的配置:
[sql] view
plaincopy
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
#Mail Proxy
mail {
auth_http 192.168.0.132:8009/AppManageConsole/auth.jspf;
pop3_capabilities "TOP" "USER";
#smtp_capabilities "no";
smtp_capabilities "SIZE 10485760" ENHANCEDSTATUSCODES 8BITMIME DSN;
#POP3 Auth
server {
listen 110;
protocol pop3;
proxy on;
pop3_auth plain;
}
#SMTP Auth
server {
listen 25;
protocol smtp;
proxy on;
#xclient off;
smtp_auth login plain;
}
}
[sql] view
plaincopy
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
#Mail Proxy
mail {
auth_http 192.168.0.132:8009/AppManageConsole/auth.jspf;
pop3_capabilities "TOP" "USER";
#smtp_capabilities "no";
smtp_capabilities "SIZE 10485760" ENHANCEDSTATUSCODES 8BITMIME DSN;
#POP3 Auth
server {
listen 110;
protocol pop3;
proxy on;
pop3_auth plain;
}
#SMTP Auth
server {
listen 25;
protocol smtp;
proxy on;
#xclient off;
smtp_auth login plain;
}
}
相关文章推荐
- NGINX引入线程池 性能提升9倍
- Windows下Nginx+PHP5(FastCgi)安装配置详解
- nginx笔记:nginx安装
- Thinkphp 伪静态Nginx配置方式
- Nginx+mysql+php-fpm负载均衡配置实例
- Nginx+PHP-FPM优化技巧总结
- nginx启动,重启,关闭命令 (另:kill -USR2 的作用)
- 更换apache到nginx的操作过程全记录
- CentOS上如何把Web服务器从Apache换到nginx
- nginx重新编译安装upload模块
- nginx FastCGI错误Primary script unknown解决办法
- 深入探讨:Nginx 502 Bad Gateway错误的解决方法
- nginx+php-fpm出现502 bad gateway错误解决方法
- nginx+php-fpm出现502 bad gateway错误解决方法
- Nginx使用的php-fpm的两种进程管理方式及优化
- 深入探讨:Nginx 502 Bad Gateway错误的解决方法
- nginx.conf文件详解及调优
- nginx FastCGI错误Primary script unknown解决办法
- CentOS上如何把Web服务器从Apache换到nginx
- 更换apache到nginx的操作过程全记录