Advertisement
finity69x2

NGINX default config

Jun 29th, 2018
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.76 KB | None | 0 0
  1. ## Version 2018/04/20 - Changelog: https://github.com/linuxserver/docker-letsencrypt/commits/master/root/defaults/default
  2.  
  3. # listening on port 80 disabled by default, remove the "#" signs to enable
  4. # redirect all traffic to https
  5. #server {
  6. # listen 80;
  7. # server_name _;
  8. # return 301 https://$host$request_uri;
  9. #}
  10.  
  11. # main server block
  12. server {
  13. listen 443 ssl default_server;
  14.  
  15. root /config/www;
  16. index index.html index.htm index.php;
  17.  
  18. server_name xxxxxxxx.duckdns.org;
  19.  
  20. # enable subfolder method reverse proxy confs
  21. include /config/nginx/proxy-confs/*.subfolder.conf;
  22.  
  23. # all ssl related config moved to ssl.conf
  24. include /config/nginx/ssl.conf;
  25.  
  26. client_max_body_size 0;
  27.  
  28. location / {
  29. try_files $uri $uri/ /index.html /index.php?$args =404;
  30. }
  31.  
  32. location ~ \.php$ {
  33. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  34. # With php7-cgi alone:
  35. fastcgi_pass 192.168.1.11:9000;
  36. # With php7-fpm:
  37. #fastcgi_pass unix:/var/run/php7-fpm.sock;
  38. fastcgi_index index.php;
  39. include /etc/nginx/fastcgi_params;
  40. }
  41.  
  42. # sample reverse proxy config for password protected couchpotato running at IP 192.168.1.50 port 5050 with base url "cp"
  43. # notice this is within the same server block as the base
  44. # don't forget to generate the .htpasswd file as described on docker hub
  45. # location ^~ /cp {
  46. # auth_basic "Restricted";
  47. # auth_basic_user_file /config/nginx/.htpasswd;
  48. # include /config/nginx/proxy.conf;
  49. # proxy_pass http://192.168.1.50:5050/cp;
  50. # }
  51.  
  52. }
  53.  
  54. # sample reverse proxy config without url base, but as a subdomain "cp", ip and port same as above
  55. # notice this is a new server block, you need a new server block for each subdomain
  56. #server {
  57. # listen 443 ssl;
  58. #
  59. # root /config/www;
  60. # index index.html index.htm index.php;
  61. #
  62. # server_name cp.*;
  63. #
  64. # include /config/nginx/ssl.conf;
  65. #
  66. # client_max_body_size 0;
  67. #
  68. # location / {
  69. # auth_basic "Restricted";
  70. # auth_basic_user_file /config/nginx/.htpasswd;
  71. # include /config/nginx/proxy.conf;
  72. # proxy_pass http://192.168.1.50:5050;
  73. # }
  74. #}
  75.  
  76. ### HOMEASSISTANT ##############################################################
  77. server {
  78. listen 443 ssl;
  79.  
  80. root /config/www;
  81. index index.html index.htm index.php;
  82.  
  83. server_name hass.xxxxxxx.duckdns.org;
  84.  
  85. include /config/nginx/ssl.conf;
  86.  
  87. client_max_body_size 0;
  88.  
  89. location / {
  90. # auth_basic "Restricted";
  91. # auth_basic_user_file /config/nginx/.htpasswd;
  92. proxy_set_header Host $host;
  93. proxy_redirect http:// https://;
  94. proxy_http_version 1.1;
  95. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  96. proxy_set_header Upgrade $http_upgrade;
  97. proxy_set_header Connection "upgrade";
  98. proxy_buffering off;
  99. proxy_ssl_verify off;
  100. # include /config/nginx/proxy.conf;
  101. proxy_pass http://192.168.1.11:yyyy;
  102. }
  103. }
  104.  
  105. ### CONFIGURATOR ###############################################################
  106. server {
  107. listen 443 ssl;
  108.  
  109. root /config/www;
  110. index index.html index.htm index.php;
  111.  
  112. server_name conf.xxxxxxx.duckdns.org;
  113.  
  114. include /config/nginx/ssl.conf;
  115.  
  116. client_max_body_size 0;
  117.  
  118. location / {
  119. auth_basic "Restricted";
  120. auth_basic_user_file /config/nginx/.htpasswd;
  121. include /config/nginx/proxy.conf;
  122. proxy_pass http://192.168.1.11:3218;
  123. }
  124. }
  125.  
  126. ### GRAFANA ####################################################################
  127. server {
  128. listen 443 ssl;
  129.  
  130. root /config/www;
  131. index index.html index.htm index.php;
  132.  
  133. server_name graf.xxxxxxx.duckdns.org;
  134.  
  135. include /config/nginx/ssl.conf;
  136.  
  137. client_max_body_size 0;
  138.  
  139. location / {
  140. # auth_basic "Restricted";
  141. # auth_basic_user_file /config/nginx/.htpasswd;
  142. include /config/nginx/proxy.conf;
  143. proxy_pass http://192.168.1.11:3003;
  144. }
  145. }
  146.  
  147. # enable subdomain method reverse proxy confs
  148. include /config/nginx/proxy-confs/*.subdomain.conf;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement