docker/nginx/default.conf
Rama master · réplica de lectura del repositorio original.
server {
listen 80;
listen 443 ssl http2;
ssl_certificate /etc/nginx/ssl/localhost.crt;
ssl_certificate_key /etc/nginx/ssl/localhost.key;
ssl_ciphers HIGH:!aNULL:!MD5;
server_name _;
#error_log /var/log/nginx.error.log warn;
root /app;
# swagger-ui (`make swagger-ui`: container uni-swagger, BASE_URL=/api-docs).
# Resolved per request via Docker's DNS, so nginx starts without it (502).
location ^~ /api-docs/ {
resolver 127.0.0.11 valid=30s ipv6=off;
set $swagger_ui http://uni-swagger:8080;
proxy_pass $swagger_ui;
}
location = /api-docs {
absolute_redirect off;
return 301 /api-docs/;
}
location / {
#limit_req zone=allthem burst=5;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET,HEAD,OPTIONS,POST,PUT';
add_header 'Access-Control-Allow-Headers' 'Origin,Accept,Authorization,X-Requested-With,Content-Type,Access-Control-Request-Method,Access-Control-Request-Headers';
include fastcgi_params;
include fpm_params;
client_max_body_size 20M;
fastcgi_param PHP_VALUE "upload_max_filesize = 30M \n post_max_size=30M";
}
# Static files location
# location ~*^.+\.(^php)$ {
# #error_log /var/log/nginx.static.error.log warn;
# include static_params;
# }
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.(htaccess|htpasswd|.svn|.bzr|.git|gitignore|idea) {
deny all;
}
# Regex locations match in file order: keep this below the dotfile deny.
location ~ ^/(assets|files)/ {
#error_log /var/log/nginx.content.error.log warn;
include static_params;
try_files $uri =404;
}
}