mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2025-08-17 05:38:28 +08:00

* Update the docker-compose deployment directory and internals * missed updates * update readme style
59 lines
1.6 KiB
Nginx Configuration File
59 lines
1.6 KiB
Nginx Configuration File
# For more information on configuration, see:
|
|
# * Official English Documentation: http://nginx.org/en/docs/
|
|
# * Official Russian Documentation: http://nginx.org/ru/docs/
|
|
|
|
user nginx;
|
|
worker_processes auto;
|
|
error_log /var/log/nginx/error.log;
|
|
pid /run/nginx.pid;
|
|
|
|
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
|
|
include /usr/share/nginx/modules/*.conf;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
sendfile on;
|
|
client_max_body_size 5M;
|
|
client_body_buffer_size 5M;
|
|
|
|
gzip on;
|
|
gzip_comp_level 2;
|
|
gzip_types text/plain text/css text/javascript application/javascript application/x-javascript application/xml application/x-httpd-php image/jpeg image/gif image/png;
|
|
gzip_vary on;
|
|
|
|
keepalive_timeout 300;
|
|
|
|
server {
|
|
listen 80 default_server;
|
|
listen [::]:80 default_server;
|
|
server_name 127.0.0.1;
|
|
|
|
root /fba;
|
|
|
|
client_max_body_size 10m; # 最大上传文件
|
|
|
|
location / {
|
|
proxy_pass http://fba_server:8001;
|
|
|
|
proxy_set_header Host $http_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_connect_timeout 300s;
|
|
proxy_send_timeout 300s;
|
|
proxy_read_timeout 300s;
|
|
}
|
|
|
|
location /static {
|
|
alias /www/fba/backend/app/static;
|
|
}
|
|
}
|
|
}
|