default 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. server {
  2. listen 80 default_server;
  3. # listen [::]:80 default_server ipv6only=on;
  4. #_SSL_PORT_#listen 443 ssl default_server;
  5. #_SSL_PORT_#listen [::]:443 ssl default_server ipv6only=on;
  6. #_SSL_PORT_#ssl_certificate /etc/nginx/ssl/nginx.crt;
  7. #_SSL_PORT_#ssl_certificate_key /etc/nginx/ssl/nginx.key;
  8. #_HTTP_PASSWORD_#auth_basic "Private Property";
  9. #_HTTP_PASSWORD_#auth_basic_user_file /etc/nginx/.htpasswd;
  10. root /usr/local/lib/web/frontend/;
  11. index index.html index.htm;
  12. #_RELATIVE_URL_ROOT_location /_RELATIVE_URL_ROOT_/ {
  13. #_RELATIVE_URL_ROOT_ rewrite /_RELATIVE_URL_ROOT_/(.*) /$1 break;
  14. #_RELATIVE_URL_ROOT_ root /usr/local/lib/web/frontend/;
  15. #_RELATIVE_URL_ROOT_}
  16. location ~ .*/(api/.*|websockify) {
  17. try_files $uri @api$http_upgrade;
  18. }
  19. location / {
  20. rewrite /approot/(.*) /$1 break;
  21. root /usr/local/lib/web/frontend/;
  22. }
  23. location @apiwebsocket {
  24. #_RELATIVE_URL_ROOT_rewrite /_RELATIVE_URL_ROOT_/(.*) $1 break;
  25. proxy_connect_timeout 7d;
  26. proxy_send_timeout 7d;
  27. proxy_read_timeout 7d;
  28. proxy_buffering off;
  29. proxy_http_version 1.1;
  30. proxy_set_header Upgrade $http_upgrade;
  31. proxy_set_header Connection "upgrade";
  32. proxy_pass http://127.0.0.1:6081;
  33. }
  34. location @api {
  35. #_RELATIVE_URL_ROOT_rewrite /_RELATIVE_URL_ROOT_/(.*) $1 break;
  36. proxy_set_header X-Real-IP $remote_addr;
  37. proxy_set_header X-Forwarded-For $remote_addr;
  38. proxy_set_header Host $host;
  39. max_ranges 0;
  40. proxy_pass http://127.0.0.1:6079;
  41. }
  42. }