Advertisement
Guest User

./data/nginx/proxy_host/1.conf

a guest
May 21st, 2025
53
0
27 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.62 KB | None | 0 0
  1. # ------------------------------------------------------------
  2. # whoami.DOMAIN
  3. # ------------------------------------------------------------
  4.  
  5. map $scheme $hsts_header {
  6.   https "max-age=63072000; includeSubDomains; preload";
  7. }
  8.  
  9. server {
  10.   set $forward_scheme http;
  11.   set $server "127.0.0.1";
  12.   set $port 2001;
  13.  
  14.   listen 80;
  15.   listen 443 ssl;
  16.   # listen [::]:80;
  17.   # listen [::]:443;
  18.   http2 on;
  19.  
  20.   server_name whoami.DOMAIN;
  21.  
  22.   # Let's Encrypt SSL
  23.   include conf.d/include/letsencrypt-acme-challenge.conf;
  24.   include conf.d/include/ssl-cache.conf;
  25.   include conf.d/include/ssl-ciphers.conf;
  26.   ssl_certificate /etc/letsencrypt/live/npm-1/fullchain.pem;
  27.   ssl_certificate_key /etc/letsencrypt/live/npm-1/privkey.pem;
  28.  
  29.   # Block Exploits
  30.   include conf.d/include/block-exploits.conf;
  31.  
  32.   # HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
  33.   add_header Strict-Transport-Security $hsts_header always;
  34.  
  35.   # Force SSL
  36.   include conf.d/include/force-ssl.conf;
  37.  
  38.   proxy_set_header Upgrade $http_upgrade;
  39.   proxy_set_header Connection $http_connection;
  40.   proxy_http_version 1.1;
  41.  
  42.   access_log /data/logs/proxy-host-1_access.log proxy;
  43.   error_log /data/logs/proxy-host-1_error.log warn;
  44.  
  45.   location / {
  46.     # HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
  47.     add_header Strict-Transport-Security $hsts_header always;
  48.  
  49.     proxy_set_header Upgrade $http_upgrade;
  50.     proxy_set_header Connection $http_connection;
  51.     proxy_http_version 1.1;
  52.  
  53.     # Proxy!
  54.     include conf.d/include/proxy.conf;
  55.   }
  56.  
  57.   # Custom
  58.   include /data/nginx/custom/server_proxy[.]conf;
  59. }
  60.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement