Advertisement
Guest User

Untitled

a guest
Oct 17th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.73 KB | None | 0 0
  1. map $http_upgrade $connection_upgrade {
  2.     default upgrade;
  3.     ''      close;
  4. }
  5.  
  6. server {
  7.     # Update this line to be your domain
  8.     server_name www.mydomain.ca;
  9.  
  10.     # These shouldn't need to be changed
  11.     listen [::]:80 default_server ipv6only=off;
  12.     return 301 https://$host$request_uri;
  13. }
  14.  
  15. server {
  16.     # Update this line to be your domain
  17.     server_name www.mydomain.ca;
  18.  
  19.     # Ensure these lines point to your SSL certificate and key
  20.     ssl_certificate /etc/letsencrypt/live/www.mydomain.ca/fullchain.pem;
  21.     ssl_certificate_key /etc/letsencrypt/live/www.mydomain.ca/privkey.pem;
  22.     # Use these lines instead if you created a self-signed certificate
  23.     # ssl_certificate /etc/nginx/ssl/cert.pem;
  24.     # ssl_certificate_key /etc/nginx/ssl/key.pem;
  25.  
  26.     # Ensure this line points to your dhparams file
  27.     ssl_dhparam /etc/nginx/ssl/dhparams.pem;
  28.  
  29.  
  30.     # These shouldn't need to be changed
  31.     listen [::]:443 default_server ipv6only=off; # if your nginx version is >= 1.9.5 you can also add the "http2" flag here
  32.     add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
  33.     ssl on;
  34.     ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  35.     ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
  36.     ssl_prefer_server_ciphers on;
  37.     ssl_session_cache shared:SSL:10m;
  38.  
  39.     proxy_buffering off;
  40.  
  41.     location /home/ {
  42.         proxy_pass http://localhost:8123;
  43.         proxy_set_header Host $host;
  44.         proxy_redirect http:// https://;
  45.         proxy_http_version 1.1;
  46.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  47.         proxy_set_header Upgrade $http_upgrade;
  48.         proxy_set_header Connection $connection_upgrade;
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement