SHARE
TWEET

reverse_proxy_404

alphabeta1 Aug 29th, 2019 (edited) 128 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. server {
  2.     listen 80;
  3.     server_name [hostname];
  4.  
  5.     error_log /var/log/nginx/unifi-443-error.log info;
  6.     access_log /var/log/nginx/unifi-443-access.log;
  7.  
  8.     location / {
  9.         root /usr/share/nginx/html;
  10.         index index.html index.htm;
  11.     }
  12.  
  13.     location /unifi/ {
  14.         root /usr/lib/unifi-video/webapps/ROOT;
  15.         rewrite ^/unifi/(.*)$ /$1 break;
  16.         proxy_pass https://localhost:7443;
  17.         proxy_set_header Host $host;
  18.         proxy_set_header X-Real-IP $remote_addr;
  19.         proxy_set_header X-Forwarded-Host $host;
  20.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  21.         proxy_set_header X-Forwarded-Proto $scheme;
  22.     }
  23.  
  24.     location /wss/ { # websocket connection
  25.                 proxy_pass https://localhost:7443;
  26.                 proxy_http_version 1.1;
  27.                 proxy_buffering off; # synchronous - for websockets
  28.                 proxy_set_header Upgrade $http_upgrade;
  29.                 proxy_set_header Connection "Upgrade";
  30.                 proxy_read_timeout 86400;
  31.     }
  32.  
  33.     listen 443 ssl; # managed by Certbot
  34.     ssl_certificate /etc/letsencrypt/live/[hostname]/fullchain.pem; # managed by Certbot
  35.     ssl_certificate_key /etc/letsencrypt/live/[hostname]/privkey.pem; # managed by Certbot
  36.     include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  37.     ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  38.  
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top