Skip to content

Instantly share code, notes, and snippets.

@klp18

klp18/owa.conf Secret

Created October 7, 2022 15:02
Show Gist options
  • Save klp18/7d16e6be4d97cd3db1ffa6521c582522 to your computer and use it in GitHub Desktop.
Save klp18/7d16e6be4d97cd3db1ffa6521c582522 to your computer and use it in GitHub Desktop.
upstream http_mail3_mrs_backend {
server 192.168.4.123:88;
ntlm 999;
}
upstream http_mail3_exchange_backend {
server 192.168.4.123:443;
keepalive 16;
ntlm 999;
}
server {
server_name owa.xxxxxxx.com;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location = / {
proxy_pass http://http_mail3_mrs_backend;
allow all;
}
location = /favicon.ico {
proxy_pass http://http_mail3_mrs_backend;
allow all;
}
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
allow 192.168.4.0/24;
deny all;
}
location / {
proxy_read_timeout 600;
proxy_send_timeout 240;
proxy_pass https://http_mail3_exchange_backend;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/owa.xxxxxxx.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/owa.xxxxxxx.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = owa.xxxxxxx.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name owa.xxxxxxx.com;
return 404; # managed by Certbot
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment