mirror of
https://github.com/rommapp/romm.git
synced 2026-06-28 14:56:01 +00:00
72 lines
2.2 KiB
Plaintext
72 lines
2.2 KiB
Plaintext
user romm;
|
|
worker_processes auto;
|
|
pid /tmp/nginx.pid;
|
|
|
|
events {
|
|
worker_connections 768;
|
|
multi_accept on;
|
|
}
|
|
|
|
http {
|
|
client_body_temp_path /tmp/client_body 1 2;
|
|
fastcgi_temp_path /tmp/fastcgi 1 2;
|
|
proxy_temp_path /tmp/proxy;
|
|
uwsgi_temp_path /tmp/uwsgi;
|
|
scgi_temp_path /tmp/scgi;
|
|
|
|
sendfile on;
|
|
tcp_nopush on;
|
|
# types_hash_max_size 2048;
|
|
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
access_log /dev/stdout;
|
|
error_log /dev/stderr;
|
|
|
|
gzip on;
|
|
|
|
# include /etc/nginx/conf.d/*.conf;
|
|
# include /etc/nginx/sites-enabled/*;
|
|
|
|
upstream uvicorn {
|
|
server unix:/tmp/uvicorn.sock;
|
|
}
|
|
|
|
server {
|
|
root /var/www/html;
|
|
listen 8080;
|
|
server_name localhost;
|
|
|
|
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;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
proxy_redirect off;
|
|
}
|
|
|
|
# OpenAPI for swagger and redoc
|
|
location /openapi.json {
|
|
proxy_pass http://uvicorn;
|
|
}
|
|
|
|
# Backend api calls
|
|
location /api {
|
|
rewrite /api/(.*) /$1 break;
|
|
proxy_pass http://uvicorn;
|
|
}
|
|
location /ws {
|
|
proxy_pass http://uvicorn;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
}
|
|
}
|
|
}
|