Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- upstream server1 {
- server 127.0.0.1:8080;
- }
- server {
- listen 443 ssl;
- ssl_certificate /etc/letsencrypt/live/PATH/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/PATH/privkey.pem;
- server_name domain.com;
- location / {
- proxy_pass http://server1;
- 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 X-Forwarded-Protocol https;
- proxy_pass_header Authorization;
- proxy_redirect off;
- proxy_http_version 1.1;
- proxy_buffering off;
- }
- }
- # HTTPS REDIRECTION
- server {
- listen 80 default_server;
- server_name _;
- return 301 https://$host$request_uri;
- }
- # DEFAULT SERVER 404
- server {
- listen 443 ssl default_server;
- ssl_certificate /etc/letsencrypt/live/PATH/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/PATH/privkey.pem;
- server_name _;
- add_header Strict-Transport-Security "max-age=0;";
- return 404;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement