Web and Mail Proxy Server Configuration
alisampras
nginx-forum at forum.nginx.org
Tue Oct 2 07:52:42 UTC 2018
Hi all,
Based on googling, i found some of the Mail proxy config as per below.
Question is, is that config is valid for both as Web server and Mail proxy?
[root at ns2 conf]# more nginx.conf
worker_processes 1;
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 xxx.xxx.com;
#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;
}
}
# 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 {
listen 443;
ssl on;
ssl_certificate /etc/ssl/remote.domain.com-unified.crt;
ssl_certificate_key /etc/ssl/remote.domain.com.key;
ssl_session_timeout 5m;
server_name remote.domain.com autodiscover.domain.com;
# Set global proxy settings
proxy_http_version 1.1;
proxy_connect_timeout 360;
proxy_read_timeout 360;
proxy_pass_request_headers on;
proxy_pass_header Date;
proxy_pass_header Server;
proxy_pass_header Authorization;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "";
location / { proxy_pass https://10.202.1.14; }
location ~* ^/owa { proxy_pass https://10.202.1.14; }
location ~* ^/ecp { proxy_pass https://10.202.1.14; }
location ~* ^/rpc { proxy_pass https://10.202.1.14; }
location ~* ^/ews { proxy_pass https://10.202.1.14; }
location ~* ^/exchweb { proxy_pass https://10.202.1.14; }
location ~* ^/public { proxy_pass https://10.202.1.14; }
location ~* ^/exchange { proxy_pass https://10.202.1.14; }
location ~* ^/Microsoft-Server-ActiveSync {
proxy_set_header X-Forwarded-Proto https;
proxy_pass https://10.202.1.14;
}
location ~* ^/autodiscover { proxy_pass https://10.202.1.14; }
error_log /usr/local/nginx/logs/owa-ssl-error.log;
access_log /usr/local/nginx/logs/owa-ssl-access.log;
}
Posted at Nginx Forum: https://forum.nginx.org/read.php?2,281456,281469#msg-281469
More information about the nginx
mailing list