dhcp.conf.tpl 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4. server_name $HOST_DHCP;
  5. return 301 https://$HOST_DHCP${DOLAR}request_uri;
  6. }
  7. map ${DOLAR}http_upgrade ${DOLAR}connection_upgrade {
  8. default upgrade;
  9. '' close;
  10. }
  11. server {
  12. listen 443 ssl;
  13. listen [::]:443;
  14. server_name $HOST_DHCP;
  15. ssl_certificate /etc/nginx/certs/fullchain.pem;
  16. ssl_certificate_key /etc/nginx/certs/privkey.pem;
  17. root /opt/dhcp/web;
  18. location /bundles/ {
  19. root /opt/dhcp/web;
  20. }
  21. location / {
  22. try_files ${DOLAR}uri /app.php${DOLAR}is_args${DOLAR}args;
  23. }
  24. #
  25. location ~ ^/(app_dev|config)\.php(/|$) {
  26. fastcgi_pass unix:/tmp/dhcp/dhcp.sock;
  27. fastcgi_split_path_info ^(.+\.php)(/.*)$;
  28. include fastcgi_params;
  29. fastcgi_param SCRIPT_FILENAME ${DOLAR}realpath_root${DOLAR}fastcgi_script_name;
  30. fastcgi_param DOCUMENT_ROOT ${DOLAR}realpath_root;
  31. fastcgi_ignore_client_abort on;
  32. fastcgi_param REMOTE_ADDR ${DOLAR}http_x_real_ip;
  33. }
  34. # PROD
  35. location ~ ^/app\.php(/|$) {
  36. fastcgi_pass unix:/tmp/dhcp/dhcp.sock;
  37. fastcgi_split_path_info ^(.+\.php)(/.*)$;
  38. include fastcgi_params;
  39. fastcgi_param SCRIPT_FILENAME ${DOLAR}realpath_root${DOLAR}fastcgi_script_name;
  40. fastcgi_param DOCUMENT_ROOT ${DOLAR}realpath_root;
  41. fastcgi_ignore_client_abort on;
  42. fastcgi_param REMOTE_ADDR ${DOLAR}http_x_real_ip;
  43. internal;
  44. }
  45. location ~ \.php$ {
  46. return 404;
  47. }
  48. location /ws {
  49. proxy_pass http://amqp:15674/ws;
  50. proxy_http_version 1.1;
  51. proxy_set_header Upgrade ${DOLAR}http_upgrade;
  52. proxy_set_header Connection ${DOLAR}connection_upgrade;
  53. }
  54. }