Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- upstream newserver {
- server ****; # this is new server, by IP address
- }
- server {
- set_real_ip_from ****;
- real_ip_header proxy_protocol;
- proxy_set_header X-Real-IP ****;
- proxy_set_header X-Forwarded-For ****;
- listen 80;
- server_name **** www.****;
- # Prevent nginx HTTP Server Detection
- server_tokens off;
- location /.well-known/acme-challenge/ {
- root /var/www/certbot;
- }
- # Enforce HTTPS
- #return 301 https://$server_name$request_uri;
- # disable SSL HERE TOO
- if ($scheme = "http") {
- return 301 https://$host$request_uri;
- }
- }
- server {
- set_real_ip_from ****;
- real_ip_header proxy_protocol;
- proxy_set_header X-Real-IP ****;
- proxy_set_header X-Forwarded-For ****;
- listen 443 default_server proxy_protocol http2 ssl; #comment SSL to disbale SSL;
- server_name **** www.****;
- ssl_certificate /etc/nginx/ssl/live/****/fullchain.pem; #comment this to disbale SSL;
- ssl_certificate_key /etc/nginx/ssl/live/****/privkey.pem; #comment this to disbale SSL;
- ssl_session_timeout 1d;
- ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
- ssl_session_tickets off;
- ssl_protocols TLSv1.2 TLSv1.3;
- ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
- ssl_prefer_server_ciphers off;
- #root /var/www/html; #Only for ssh?
- # Managing literal requests to the JupyterHub frontend
- location / {
- proxy_pass "http://172.19.0.23:81";
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Forwarded-Host $host;
- proxy_set_header X-Forwarded-Prefix /;
- }
- # Managing requests to verify letsencrypt host
- location ~ /.well-known {
- allow all;
- }
- # Prevent nginx HTTP Server Detection
- server_tokens off;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement