Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 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. gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
  20. log_format vhost '$host $remote_addr - $remote_user [$time_local] '
  21. '"$request" $status $body_bytes_sent '
  22. '"$http_referer" "$http_user_agent"';
  23. access_log off;
  24. # HTTP 1.1 support
  25. proxy_http_version 1.1;
  26. proxy_buffering off;
  27. proxy_set_header Host $http_host;
  28. proxy_set_header Upgrade $http_upgrade;
  29. proxy_set_header Connection $proxy_connection;
  30. proxy_set_header X-Real-IP $remote_addr;
  31. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  32. proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
  33. proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;
  34. # Mitigate httpoxy attack (see README for details)
  35. proxy_set_header Proxy "";
  36. server {
  37. server_name _; # This is just an invalid value which will never trigger on a real hostname.
  38. listen 80;
  39. access_log /var/log/nginx/access.log vhost;
  40. return 503;
  41. }
  42. upstream pihole.htpc.lan {
  43. ## Can be connect with "dockerfiles_default" network
  44. # pi-hole
  45. server 172.18.0.4:80;
  46. }
  47. server {
  48. server_name pihole.htpc.lan;
  49. listen 80 default_server;
  50. access_log /var/log/nginx/access.log vhost;
  51. location / {
  52. proxy_pass http://pihole.htpc.lan;
  53. }
  54. }
  55. upstream sabnzbd.htpc.lan {
  56. ## Can be connect with "dockerfiles_default" network
  57. # sabnzbd
  58. server 172.18.0.3 down;
  59. }
  60. server {
  61. server_name sabnzbd.htpc.lan;
  62. listen 80 ;
  63. access_log /var/log/nginx/access.log vhost;
  64. location / {
  65. proxy_pass http://sabnzbd.htpc.lan;
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement