Guest User

Untitled

a guest
Jul 15th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. # If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the
  2. # scheme used to connect to this server
  3. map $http_x_forwarded_proto $proxy_x_forwarded_proto {
  4. default $http_x_forwarded_proto;
  5. '' $scheme;
  6. }
  7. # If we receive X-Forwarded-Port, pass it through; otherwise, pass along the
  8. # server port the client connected to
  9. map $http_x_forwarded_port $proxy_x_forwarded_port {
  10. default $http_x_forwarded_port;
  11. '' $server_port;
  12. }
  13. # If we receive Upgrade, set Connection to "upgrade"; otherwise, delete any
  14. # Connection header that may have been passed to this server
  15. map $http_upgrade $proxy_connection {
  16. default upgrade;
  17. '' close;
  18. }
  19. # Apply fix for very long server names
  20. server_names_hash_bucket_size 128;
  21. # Default dhparam
  22. ssl_dhparam /etc/nginx/dhparam/dhparam.pem;
  23. # Set appropriate X-Forwarded-Ssl header
  24. map $scheme $proxy_x_forwarded_ssl {
  25. default off;
  26. https on;
  27. }
  28. gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
  29. log_format vhost '$host $remote_addr - $remote_user [$time_local] '
  30. '"$request" $status $body_bytes_sent '
  31. '"$http_referer" "$http_user_agent"';
  32. access_log off;
  33. resolver 172.31.0.2;
  34. # HTTP 1.1 support
  35. proxy_http_version 1.1;
  36. proxy_buffering off;
  37. proxy_set_header Host $http_host;
  38. proxy_set_header Upgrade $http_upgrade;
  39. proxy_set_header Connection $proxy_connection;
  40. proxy_set_header X-Real-IP $remote_addr;
  41. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  42. proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
  43. proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl;
  44. proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;
  45. # Mitigate httpoxy attack (see README for details)
  46. proxy_set_header Proxy "";
  47. server {
  48. server_name _; # This is just an invalid value which will never trigger on a real hostname.
  49. listen 80;
  50. access_log /var/log/nginx/access.log vhost;
  51. return 503;
  52. }
  53. # ssrv.talking-ads.com
  54. upstream ssrv.talking-ads.com {
  55. ## Can be connected with "bridge" network
  56. # display
  57. server 172.17.0.2:3001;
  58. }
  59. server {
  60. server_name ssrv.talking-ads.com;
  61. listen 80 ;
  62. access_log /var/log/nginx/access.log vhost;
  63. location / {
  64. proxy_pass http://ssrv.talking-ads.com;
  65. }
  66. }
Add Comment
Please, Sign In to add comment