Advertisement
Guest User

ha.mydomain.ru

a guest
Jul 8th, 2018
1,370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. map $http_upgrade $connection_upgrade {
  2. default upgrade;
  3. '' close;
  4. }
  5. server {
  6. root /var/www/ha.mydomain.ru/html;
  7. index index.html index.htm index.nginx-debian.html;
  8. server_name ha.mydomain.ru www.ha.mydomain.ru;
  9. access_log /var/log/nginx/ha.mydomain.ru-access.log;
  10. error_log /var/log/nginx/ha.mydomain.ru-error.log;
  11. location / {
  12. proxy_pass http://vpn_lan_ip:8123;
  13. proxy_set_header Host $host;
  14. proxy_http_version 1.1;
  15. proxy_set_header Upgrade $http_upgrade;
  16. proxy_set_header Connection "upgrade";
  17. }
  18.  
  19. location /api/websocket {
  20. proxy_pass http://vpn_lan_ip:8123/api/websocket;
  21. proxy_set_header Host $host;
  22. proxy_http_version 1.1;
  23. proxy_set_header Upgrade $http_upgrade;
  24. proxy_set_header Connection "upgrade";
  25. }
  26.  
  27. listen [::]:443 ssl; # managed by Certbot
  28. listen 443 ssl; # managed by Certbot
  29. ssl_certificate /etc/letsencrypt/live/ha.mydomain.ru/fullchain.pem; # managed by Certbot
  30. ssl_certificate_key /etc/letsencrypt/live/ha.mydomain.ru/privkey.pem; # managed by Certbot
  31. include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  32. ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  33.  
  34.  
  35. }
  36. server {
  37. if ($host = www.ha.mydomain.ru) {
  38. return 301 https://$host$request_uri;
  39. } # managed by Certbot
  40.  
  41.  
  42. if ($host = ha.mydomain.ru) {
  43. return 301 https://$host$request_uri;
  44. } # managed by Certbot
  45.  
  46.  
  47. listen 80;
  48. listen [::]:80;
  49. server_name ha.mydomain.ru www.ha.mydomain.ru;
  50. return 404; # managed by Certbot
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement