This repository has been archived on 2021-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
docker-standardfile/docker/nginx.conf

64 lines
1.3 KiB
Nginx Configuration File

upstream puma_sample_rails_docker_app {
server app:3000;
}
server {
listen 80;
client_max_body_size 4G;
keepalive_timeout 10;
error_page 500 502 504 /500.html;
error_page 503 @503;
server_name localhost puma_sample_rails_docker_app;
root /data/src/public;
try_files $uri/index.html $uri @puma_sample_rails_docker_app;
location @puma_sample_rails_docker_app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://puma_sample_rails_docker_app;
# limit_req zone=one;
access_log /data/src/log/nginx.access.log;
error_log /data/src/log/nginx.error.log;
}
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
}
location = /50x.html {
root html;
}
location = /404.html {
root html;
}
location @503 {
error_page 405 = /system/maintenance.html;
if (-f $document_root/system/maintenance.html) {
rewrite ^(.*)$ /system/maintenance.html break;
}
rewrite ^(.*)$ /503.html break;
}
if ($request_method !~ ^(GET|HEAD|PUT|PATCH|POST|DELETE|OPTIONS)$ ){
return 405;
}
if (-f $document_root/system/maintenance.html) {
return 503;
}
location ~ \.(php|html)$ {
return 405;
}
}