Advertisement
METAJIJI

mail.univers.su_https

Feb 4th, 2016
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 0.81 KB | None | 0 0
  1. server {
  2.     listen 80;
  3.     server_name mail.univers.su;
  4.     return 301 https://$server_name$request_uri; # enforce https
  5. }
  6.  
  7. server {
  8.     listen 443 ssl;
  9.     server_name mail.univers.su;
  10.  
  11.     access_log /var/log/nginx/mail.univers.su_https_access.log;
  12.     error_log /var/log/nginx/mail.univers.su_https_error.log;
  13.  
  14.     include _ssl_pfs.conf;
  15.     ssl_dhparam /etc/ssl/univers.su/dhparam2048.pem;
  16.  
  17.     location / {
  18.         proxy_pass http://192.168.4.20;
  19.         proxy_buffering off;
  20.         proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
  21.  
  22.         # Set headers
  23.         proxy_set_header Host $host;
  24.         proxy_set_header X-Real-IP $remote_addr;
  25.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  26.  
  27.         # Most PHP, Python, Rails, Java App can use this header
  28.         proxy_set_header X-Forwarded-Proto https;
  29.         proxy_redirect off;
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement