X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=docker%2Fnginx%2Fnginx.conf;fp=docker%2Fnginx%2Fnginx.conf;h=7e82a0f8978f53ef77004019901e461255b97a06;hb=540ef5e084db2295d7ca476c980ec10fb90e9722;hp=0000000000000000000000000000000000000000;hpb=5ad863c63a023d754998a08ec55f43b3ebe2ede9;p=github%2Fwallabag%2Fwallabag.git diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf new file mode 100644 index 00000000..7e82a0f8 --- /dev/null +++ b/docker/nginx/nginx.conf @@ -0,0 +1,89 @@ +user nginx; +worker_processes 1; +pid /var/run/nginx.pid; + +events { + worker_connections 2048; + multi_accept on; + use epoll; +} + +http { + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + server_tokens off; + sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 15; + types_hash_max_size 2048; + include /etc/nginx/mime.types; + default_type application/octet-stream; + access_log off; + error_log off; + gzip on; + gzip_disable "msie6"; + open_file_cache max=100; + + + upstream php-upstream { + server php:9000; + } + + server { + #server_name domain.tld www.domain.tld; + root /var/www/html/web; + + location / { + # try to serve file directly, fallback to app.php + try_files $uri /app.php$is_args$args; + } + # DEV + # This rule should only be placed on your development environment + # In production, don't include this and don't deploy app_dev.php or config.php + location ~ ^/(app_dev|config)\.php(/|$) { + fastcgi_pass php-upstream; + fastcgi_split_path_info ^(.+\.php)(/.*)$; + include fastcgi_params; + # When you are using symlinks to link the document root to the + # current version of your application, you should pass the real + # application path instead of the path to the symlink to PHP + # FPM. + # Otherwise, PHP's OPcache may not properly detect changes to + # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 + # for more information). + fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; + fastcgi_param DOCUMENT_ROOT $realpath_root; + } + # PROD + location ~ ^/app\.php(/|$) { + fastcgi_pass php-upstream; + fastcgi_split_path_info ^(.+\.php)(/.*)$; + include fastcgi_params; + # When you are using symlinks to link the document root to the + # current version of your application, you should pass the real + # application path instead of the path to the symlink to PHP + # FPM. + # Otherwise, PHP's OPcache may not properly detect changes to + # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 + # for more information). + fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; + fastcgi_param DOCUMENT_ROOT $realpath_root; + # Prevents URIs that include the front controller. This will 404: + # http://domain.tld/app.php/some-path + # Remove the internal directive to allow URIs like this + internal; + } + + error_log /var/log/nginx/project_error.log; + access_log /var/log/nginx/project_access.log; + } + +} + +daemon off;