Advertisement
Guest User

Untitled

a guest
Jul 19th, 2021
737
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. server {
  2. server_name YOUR_DOMAIN_NAME: example.com;
  3.  
  4. location / { # Root goes to container 1
  5. proxy_set_header Host $host;
  6. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  7. proxy_set_header X-Real-IP $remote_addr;
  8. proxy_pass http://172.18.0.13:5000;
  9. auth_basic "Restricted Content";
  10. auth_basic_user_file /etc/nginx/.htpasswd;
  11. }
  12.  
  13. location /api/ { # API goes to container 2
  14. proxy_set_header Host $host;
  15. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  16. proxy_set_header X-Real-IP $remote_addr;
  17. proxy_pass http://172.18.0.11:5000/api/;
  18. }
  19.  
  20. location /api/v2/ { # API V2 goes to container 3
  21. proxy_set_header Host $host;
  22. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  23. proxy_set_header X-Real-IP $remote_addr;
  24. proxy_pass http://172.18.0.12/api/;
  25. # Micro caching
  26. #proxy_cache microcacheapi;
  27. #proxy_cache_valid 200 1s;
  28. #proxy_cache_use_stale updating;
  29. #proxy_cache_background_update on;
  30. #proxy_cache_lock on;
  31. }
  32.  
  33. location /privacy { # Goes to www folder to get some static page
  34. root /var/www/example.com;
  35. index privacy.html index.htm index.html;
  36. try_files $uri $uri.html $uri/ =404;
  37. }
  38. # pass PHP scripts to FastCGI server
  39. #
  40. #location ~ \.php$ {
  41. # include snippets/fastcgi-php.conf;
  42. #
  43. # # With php-fpm (or other unix sockets):
  44. # fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
  45. # # With php-cgi (or other tcp sockets):
  46. # fastcgi_pass 127.0.0.1:9000;
  47. #}
  48.  
  49. # deny access to .htaccess files, if Apache's document root
  50. # concurs with nginx's one
  51. #
  52. #location ~ /\.ht {
  53. # deny all;
  54. #}
  55.  
  56. listen [::]:443 ssl http2 ipv6only=on; # managed by Certbot
  57. listen 443 ssl http2; # managed by Certbot
  58.  
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement