Advertisement
Guest User

Untitled

a guest
Dec 13th, 2018
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1. here is my configuration:
  2.  
  3. letsencrypt: # https://github.com/linuxserver/docker-letsencrypt
  4. container_name: letsencrypt
  5. image: linuxserver/letsencrypt:latest
  6. restart: unless-stopped
  7. volumes:
  8. - /etc/localtime:/etc/localtime:ro
  9. - /srv/docker/letsencrypt:/config
  10. environment:
  11. - PGID=1000
  12. - PUID=1000
  13. - URL=xxx.duckdns.org
  14. - SUBDOMAINS=wildcard
  15. - VALIDATION=duckdns #http
  16. - TZ=Europe/London
  17. - DUCKDNSTOKEN=token
  18. ports:
  19. - "80:80"
  20. - "443:443"
  21.  
  22.  
  23. duckdns:
  24. container_name: duckdns
  25. image: linuxserver/duckdns
  26. restart: unless-stopped
  27. volumes:
  28. - /srv/docker/duckdns:/config
  29. environment:
  30. - PGID=1000
  31. - PUID=1000
  32. - SUBDOMAINS=xxx.duckdns.org
  33. - TOKEN=token
  34. - LOG_FILE=true
  35. - TZ=Europe/London
  36. ports:
  37. - "1480:80"
  38. and this is my default file in /srv/docker/letsencrypt/nginx/site-confs/default
  39.  
  40. #### PORT 80 ACTIVE
  41. server {
  42. listen 80;
  43. server_name xxx.duckdns.org;
  44. return 301 https://$host$request_uri;
  45. }
  46.  
  47. # main server block
  48. server {
  49. listen 443 ssl default_server;
  50.  
  51. root /config/www;
  52. index index.html index.htm index.php;
  53.  
  54. server_name xxx.duckdns.org;
  55.  
  56. # enable subfolder method reverse proxy confs
  57. include /config/nginx/proxy-confs/*.subfolder.conf;
  58.  
  59. # all ssl related config moved to ssl.conf
  60. include /config/nginx/ssl.conf;
  61.  
  62. client_max_body_size 0;
  63.  
  64. location / {
  65. try_files $uri $uri/ /index.html /index.php?$args =404;
  66. }
  67. location ~ \.php$ {
  68. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  69. # With php7-cgi alone:
  70. fastcgi_pass 10.10.10.211:9001;
  71. #fastcgi_pass 127.0.0.1:9001;
  72. # With php7-fpm:
  73. #fastcgi_pass unix:/var/run/php7-fpm.sock;
  74. fastcgi_index index.php;
  75. include /etc/nginx/fastcgi_params;
  76. }
  77. }
  78.  
  79. ### HOMEASSISTANT
  80. server {
  81. listen 443 ssl;
  82.  
  83. root /config/www;
  84. index index.html index.htm index.php;
  85.  
  86. server_name xxx.duckdns.org;
  87.  
  88. include /config/nginx/ssl.conf;
  89.  
  90. client_max_body_size 0;
  91.  
  92. location / {
  93. # auth_basic "Restricted";
  94. # auth_basic_user_file /config/nginx/.htpasswd;
  95. proxy_set_header Host $host;
  96. proxy_redirect http:// https://;
  97. proxy_http_version 1.1;
  98. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  99. proxy_set_header Upgrade $http_upgrade;
  100. proxy_set_header Connection "upgrade";
  101. proxy_buffering off;
  102. proxy_ssl_verify off;
  103. # include /config/nginx/proxy.conf;
  104. }
  105. }
  106.  
  107. # enable subdomain method reverse proxy confs
  108. include /config/nginx/proxy-confs/*.subdomain.conf;
  109. I have also forwarded port 80 to 80 and 443 to 443. when I go to my page i.e. https://xxx.duckdns.org I get the following :
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement