Guest User

Untitled

a guest
Jul 20th, 2020
4,135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.16 KB | None | 0 0
  1. server {
  2.     listen 80;
  3.     server_name your.domain.tld;
  4.     return 301 https://$host$request_uri;
  5.     }
  6.  
  7. server {
  8.     listen 443 ssl http2;
  9.     server_name your.domain.tld;
  10.  
  11.     root /config/www/folder;
  12.     index index.html index.htm index.php;
  13.  
  14.     include /config/nginx/ssl.conf;
  15.  
  16.     client_max_body_size 0;
  17.  
  18.     allow  192.168.88.0/24;
  19.     allow  10.253.0.1/24;
  20.     deny   all;
  21.  
  22.     error_page 403 /error403.html;
  23.     location = /error403.html {
  24.     root /config/www/folder;
  25.     allow all;
  26.     }
  27.    
  28.     location = /magicword.mp4 {
  29.     root /config/www/folder;
  30.     allow all;
  31.     }
  32.    
  33.     location = /favicon.ico {
  34.     root /config/www/folder;
  35.     allow all;
  36.     }
  37.    
  38.     location / {   
  39.     proxy_pass https://IP:PORT;
  40.     proxy_buffering off;
  41.     proxy_http_version 1.1;
  42.     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  43.     proxy_set_header Upgrade $http_upgrade;
  44.     proxy_set_header Connection $http_connection;
  45.     access_log off;
  46.     }
  47.    
  48.     location ~ \.php$ {
  49.         fastcgi_split_path_info ^(.+\.php)(/.+)$;
  50.         # With php7-cgi alone:
  51.         fastcgi_pass 127.0.0.1:9000;
  52.         # With php7-fpm:
  53.         #fastcgi_pass unix:/var/run/php7-fpm.sock;
  54.         fastcgi_index index.php;
  55.         include /etc/nginx/fastcgi_params;
  56.     }  
  57. }
Add Comment
Please, Sign In to add comment