Advertisement
Guest User

ngnix

a guest
Nov 11th, 2019
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 1.59 KB | None | 0 0
  1. ## Version 2019/08/01 - Changelog: https://github.com/linuxserver/docker-letsencrypt/commits/master/root/defaults/default
  2.  
  3. # redirect all traffic to https
  4. server {
  5.     listen 80 default_server;
  6.     listen [::]:80 default_server;
  7.     server_name *.domain.dev;
  8.     return 301 https://$host$request_uri;
  9. }
  10.  
  11. # main server block
  12. server {
  13.     listen 443 ssl http2 default_server;
  14.     listen [::]:443 ssl http2 default_server;
  15.  
  16.     root /config/www/root;
  17.     index index.html index.htm index.php;
  18.  
  19.     server_name *.domain.dev;
  20.  
  21.     # enable subfolder method reverse proxy confs
  22.     include /config/nginx/proxy-confs/*.subfolder.conf;
  23.  
  24.     # all ssl related config moved to ssl.conf
  25.     include /config/nginx/ssl.conf;
  26.  
  27.     # enable for ldap auth
  28.     #include /config/nginx/ldap.conf;
  29.  
  30.     client_max_body_size 0;
  31.  
  32.     location / {
  33.         #try_files $uri $uri/ /index.html /index.php?$args =404;
  34.         try_files $uri $uri/ /index.php?$args;   #use this for wordpress sites.
  35.     }
  36.  
  37.     location ~ \.php$ {
  38.         fastcgi_split_path_info ^(.+\.php)(/.+)$;
  39.         fastcgi_pass 127.0.0.1:9000;
  40.         fastcgi_index index.php;
  41.         include /etc/nginx/fastcgi_params;
  42.     }
  43. }
  44.  
  45. #subdomain 1
  46. server {
  47.     listen 443 ssl http2;
  48.     root /config/www/subdomain;
  49.     index index.html index.htm index.php;
  50.     server_name sub1.domain.dev;
  51.    
  52.     include /config/nginx/proxy-confs/*.subfolder.conf;
  53.     include /config/nginx/ssl.conf;
  54.     client_max_body_size 0;
  55.     location / {
  56.         try_files $uri $uri/ /index.php?$args;
  57.     }
  58.     location ~ \.php$ {
  59.         fastcgi_split_path_info ^(.+\.php)(/.+)$;
  60.         fastcgi_pass 127.0.0.1:9000;
  61.         fastcgi_index index.php;
  62.         include /etc/nginx/fastcgi_params;
  63.     }
  64.  
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement