brew install nginx
nginx
nginx -s stop
など
server {
listen 8080;
server_name localhost;
# ↓/mediaの物理パスを指定
location /media {
alias /Volumes/SSD-PGU3-A;
}
# proxy_passにgunicorn側のurlを指定する
location / {
# root html;
# index index.html index.htm;
proxy_pass http://127.0.0.1:8000;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /sitemap.xml {
root /opt/bitnami/var/static;
}
location /__media__/ {
return 301 https://$host;
}
gzip on;
gzip_types text/plain application/xml;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000;