Correction configuration nginx en lien avec bug https://github.com/getgrav/grav-plugin-form/issues/577

This commit is contained in:
Navas 2023-01-18 22:43:52 +01:00
parent 4d896bb0f4
commit 53e966e30e
3 changed files with 63 additions and 0 deletions

View file

@ -10,6 +10,7 @@
with_items:
- docker-compose.yml
- robots-sitemap.txt
- default.conf
notify: docker-compose-up

61
templates/default.conf Normal file
View file

@ -0,0 +1,61 @@
#config-v1
server {
listen 80 default_server;
listen 443 ssl;
root /app/www/public;
index index.html index.htm index.php;
server_name _;
ssl_certificate /config/keys/cert.crt;
ssl_certificate_key /config/keys/cert.key;
client_max_body_size 0;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~* /(\.git|cache|bin|logs|backup|tests)/.*$ { return 403; }
# deny running scripts inside core system folders
location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
# deny running scripts inside user folder
location ~* /user/.*\.(txt|md|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
# deny access to specific files in the root folder
location ~ /(LICENSE\.txt|composer\.lock|composer\.json|nginx\.conf|web\.config|htaccess\.txt|\.htaccess) { return 403; }
# location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
# expires 30d;
# add_header Vary Accept-Encoding;
# log_not_found off;
# }
# location ~* ^.+\.(?:css|cur|js|jpe?g|gif|htc|ico|png|html|xml|otf|ttf|eot|woff|woff2|svg)$ {
# access_log off;
# expires 30d;
# add_header Cache-Control public;
# ## No need to bleed constant updates. Send the all shebang in one
# ## fell swoop.
# tcp_nodelay off;
# ## Set the OS file cache.
# open_file_cache max=3000 inactive=120s;
# open_file_cache_valid 45s;
# open_file_cache_min_uses 2;
# open_file_cache_errors off;
# }
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}
}

View file

@ -11,6 +11,7 @@ services:
- TZ=Europe/Paris
volumes:
- ./robots-sitemap.txt:/app/grav-admin/robots.txt
- ./default.conf:/config/nginx/site-confs/default.conf
- {{ docker_grav_data_dir }}/{{ docker_grav_service_id }}/config:/config
restart: always
labels: