Created
June 20, 2024 05:50
-
-
Save abhi-io/80dffb3db427835ebfc7ed77a897cdfa to your computer and use it in GitHub Desktop.
Revisions
-
abhi-io created this gist
Jun 20, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,51 @@ # Define an upstream block for backend services upstream api_backend { server localhost:6565; } # HTTP server block to handle requests server { listen 80; server_name ; # Frontend Docker container location / { proxy_pass http://localhost:3000; # Optional: Add additional proxy settings if needed proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } # API Docker container location /api/ { proxy_pass http://api_backend/api/ ; # Optional: Add additional proxy settings if needed proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } # Optional: If you have other static files to serve # location /static/ { # alias /path/to/your/static/files; # # Optional: Add more directives as needed # } # Optional: If you have other services or fallback # location /other/ { # proxy_pass http://other_service/; # # Optional: Add more directives as needed # } # Optional: Custom error handling # error_page 404 /404.html; # location = /404.html { # root /path/to/your/error/files; # internal; # } # Additional server settings can go here }