Advertisement
Guest User

Untitled

a guest
Dec 13th, 2018
216
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. - EMAIL=xxxx@yahoo.com
  14. - URL=xxx.duckdns.org
  15. - SUBDOMAINS=wildcard
  16. - VALIDATION=duckdns #http
  17. - TZ=Europe/London
  18. - DUCKDNSTOKEN=token
  19. ports:
  20. - "80:80"
  21. - "443:443"
  22.  
  23.  
  24. duckdns:
  25. container_name: duckdns
  26. image: linuxserver/duckdns
  27. restart: unless-stopped
  28. volumes:
  29. - /srv/docker/duckdns:/config
  30. environment:
  31. - PGID=1000
  32. - PUID=1000
  33. - SUBDOMAINS=xxx.duckdns.org
  34. - TOKEN=token
  35. - LOG_FILE=true
  36. - TZ=Europe/London
  37. ports:
  38. - "1480:80"
  39. and this is my default file in /srv/docker/letsencrypt/nginx/site-confs/default
  40.  
  41. #### PORT 80 ACTIVE
  42. server {
  43. listen 80;
  44. server_name xxx.duckdns.org;
  45. return 301 https://$host$request_uri;
  46. }
  47.  
  48. # main server block
  49. server {
  50. listen 443 ssl default_server;
  51.  
  52. root /config/www;
  53. index index.html index.htm index.php;
  54.  
  55. server_name xxx.duckdns.org;
  56.  
  57. # enable subfolder method reverse proxy confs
  58. include /config/nginx/proxy-confs/*.subfolder.conf;
  59.  
  60. # all ssl related config moved to ssl.conf
  61. include /config/nginx/ssl.conf;
  62.  
  63. client_max_body_size 0;
  64.  
  65. location / {
  66. try_files $uri $uri/ /index.html /index.php?$args =404;
  67. }
  68. location ~ \.php$ {
  69. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  70. # With php7-cgi alone:
  71. fastcgi_pass 10.10.10.211:9001;
  72. #fastcgi_pass 127.0.0.1:9001;
  73. # With php7-fpm:
  74. #fastcgi_pass unix:/var/run/php7-fpm.sock;
  75. fastcgi_index index.php;
  76. include /etc/nginx/fastcgi_params;
  77. }
  78. }
  79.  
  80. ### HOMEASSISTANT
  81. server {
  82. listen 443 ssl;
  83.  
  84. root /config/www;
  85. index index.html index.htm index.php;
  86.  
  87. server_name xxx.duckdns.org;
  88.  
  89. include /config/nginx/ssl.conf;
  90.  
  91. client_max_body_size 0;
  92.  
  93. location / {
  94. # auth_basic "Restricted";
  95. # auth_basic_user_file /config/nginx/.htpasswd;
  96. proxy_set_header Host $host;
  97. proxy_redirect http:// https://;
  98. proxy_http_version 1.1;
  99. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  100. proxy_set_header Upgrade $http_upgrade;
  101. proxy_set_header Connection "upgrade";
  102. proxy_buffering off;
  103. proxy_ssl_verify off;
  104. # include /config/nginx/proxy.conf;
  105. }
  106. }
  107.  
  108. # enable subdomain method reverse proxy confs
  109. include /config/nginx/proxy-confs/*.subdomain.conf;
  110. 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