mirror of
https://github.com/wassname/flask-bootstrap.git
synced 2026-06-27 16:10:14 +08:00
65 lines
1.5 KiB
Nginx Configuration File
65 lines
1.5 KiB
Nginx Configuration File
worker_processes 1;
|
|
pid etc/nginx.pid;
|
|
#user ec2-user;
|
|
error_log logs/nginx-error.log;
|
|
#daemon off;
|
|
worker_rlimit_nofile 8192;
|
|
events {
|
|
#use epoll;
|
|
#use kqueue;
|
|
worker_connections 8000;
|
|
accept_mutex off;
|
|
}
|
|
|
|
http {
|
|
# Some sensible defaults.
|
|
include mime.types;
|
|
default_type application/octet-stream;
|
|
keepalive_timeout 10;
|
|
client_max_body_size 20m;
|
|
sendfile on;
|
|
gzip on;
|
|
|
|
gzip_proxied expired no-cache no-store private auth;
|
|
gzip_disable "MSIE [1-6]\.";
|
|
gzip_vary on;
|
|
|
|
# Directories
|
|
client_body_temp_path tmp/client_body/ 2 2;
|
|
fastcgi_temp_path tmp/fastcgi/;
|
|
proxy_temp_path tmp/proxy/;
|
|
uwsgi_temp_path tmp/uwsgi/;
|
|
|
|
# Logging
|
|
access_log logs/nginx-access.log combined;
|
|
|
|
upstream fysv {
|
|
# Distribute requests to servers based on client IP. This keeps load
|
|
# balancing fair but consistent per-client. In this instance we're
|
|
# only using one uWGSI worker anyway.
|
|
ip_hash;
|
|
server unix:tmp/app.sock;
|
|
}
|
|
|
|
server {
|
|
#listen 80;
|
|
listen 5000;
|
|
server_name app;
|
|
charset utf-8;
|
|
|
|
expires 1M;
|
|
|
|
location /static/ {
|
|
expires max;
|
|
alias static/;
|
|
access_log logs/static.log;
|
|
}
|
|
|
|
# Finally, send all non-media requests to the Django server.
|
|
location / {
|
|
uwsgi_pass app;
|
|
include uwsgi_params;
|
|
}
|
|
}
|
|
}
|