|
|
user nginx; |
|
|
worker_processes auto; |
|
|
error_log /var/log/nginx/error.log warn; |
|
|
pid /var/run/nginx.pid; |
|
|
|
|
|
|
|
|
events { |
|
|
worker_connections 1024; |
|
|
} |
|
|
|
|
|
http { |
|
|
include /etc/nginx/mime.types; |
|
|
default_type application/octet-stream; |
|
|
sendfile on; |
|
|
keepalive_timeout 65; |
|
|
|
|
|
server { |
|
|
listen 7860; |
|
|
server_name localhost; |
|
|
|
|
|
|
|
|
location / { |
|
|
root /home/user/app/frontend_dist; |
|
|
try_files $uri $uri/ /index.html; |
|
|
} |
|
|
|
|
|
|
|
|
location /api/ { |
|
|
proxy_pass http://127.0.0.1:7860/api/; |
|
|
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; |
|
|
} |
|
|
} |
|
|
} |
|
|
|