Skip to content

Instantly share code, notes, and snippets.

@uzbekdev1
Last active October 6, 2025 08:45
Show Gist options
  • Save uzbekdev1/9eb3b3925fc2c932c83f83fa4ef4418a to your computer and use it in GitHub Desktop.
Save uzbekdev1/9eb3b3925fc2c932c83f83fa4ef4418a to your computer and use it in GitHub Desktop.
worker_processes auto;
events {
worker_connections 1024;
}
http {
upstream restApi {
server https://ip:port;
}
server {
listen 80;
server_name localhost;
sendfile on;
location / {
root /app/dist/;
index index.html;
try_files $uri $uri/ /index.html;
}
location = /api {
proxy_pass http://restApi;
proxy_redirect off;
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
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;
proxy_set_header X-Forwarded-Host $server_name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment