@@ -19,87 +19,87 @@ server {
1919}
2020
2121server {
22- #listen 443 ssl http2;
23- #listen [::]:443 ipv6only=on ssl http2;
24- #
25- server_name ${NGINX_HOST} www.${NGINX_HOST};
26- #
27- #ssl_certificate /etc/letsencrypt/live/${NGINX_HOST}/fullchain.pem;
28- #ssl_certificate_key /etc/letsencrypt/live/${NGINX_HOST}/privkey.pem;
29- #ssl_trusted_certificate /etc/letsencrypt/live/${NGINX_HOST}/chain.pem;
30- #ssl_dhparam /etc/letsencrypt/ssl-dhparam.pem;
31- include /etc/letsencrypt/options-ssl-nginx.conf;
22+ #listen 443 ssl http2;
23+ #listen [::]:443 ipv6only=on ssl http2;
24+ #
25+ server_name ${NGINX_HOST} www.${NGINX_HOST};
26+ #
27+ #ssl_certificate /etc/letsencrypt/live/${NGINX_HOST}/fullchain.pem;
28+ #ssl_certificate_key /etc/letsencrypt/live/${NGINX_HOST}/privkey.pem;
29+ #ssl_trusted_certificate /etc/letsencrypt/live/${NGINX_HOST}/chain.pem;
30+ #ssl_dhparam /etc/letsencrypt/ssl-dhparam.pem;
31+ include /etc/letsencrypt/options-ssl-nginx.conf;
3232
33- root /var/www/html/webapp/public;
34- index index.php;
33+ root /var/www/html/webapp/public;
34+ index index.php;
3535
36- location / {
37- try_files $uri /index.php$is_args$args;
38- }
36+ location / {
37+ try_files $uri /index.php$is_args$args;
38+ }
3939
40- # optionally disable falling back to PHP script for the asset directories;
41- # nginx will return a 404 error when files are not found instead of passing the
42- # request to Symfony (improves performance but Symfony's 404 page is not displayed)
43- # location /bundles {
44- # try_files $uri =404;
45- # }
40+ # optionally disable falling back to PHP script for the asset directories;
41+ # nginx will return a 404 error when files are not found instead of passing the
42+ # request to Symfony (improves performance but Symfony's 404 page is not displayed)
43+ # location /bundles {
44+ # try_files $uri =404;
45+ # }
4646
47- location ~ ^/index\.php(/|$) {
48- fastcgi_pass docker_symfony;
47+ location ~ ^/index\.php(/|$) {
48+ fastcgi_pass docker_symfony;
4949 # fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
50- fastcgi_split_path_info ^(.+\.php)(/.*)$;
51- include fastcgi_params;
50+ fastcgi_split_path_info ^(.+\.php)(/.*)$;
51+ include fastcgi_params;
5252
53- # optionally set the value of the environment variables used in the application
54- # fastcgi_param APP_ENV prod;
55- # fastcgi_param APP_SECRET <app-secret-id>;
56- # fastcgi_param DATABASE_URL "mysql://db_user:db_pass@host:3306/db_name";
53+ # optionally set the value of the environment variables used in the application
54+ # fastcgi_param APP_ENV prod;
55+ # fastcgi_param APP_SECRET <app-secret-id>;
56+ # fastcgi_param DATABASE_URL "mysql://db_user:db_pass@host:3306/db_name";
5757
58- # When you are using symlinks to link the document root to the
59- # current version of your application, you should pass the real
60- # application path instead of the path to the symlink to PHP
61- # FPM.
62- # Otherwise, PHP's OPcache may not properly detect changes to
63- # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
64- # for more information).
65- # Caveat: When PHP-FPM is hosted on a different machine from nginx
66- # $realpath_root may not resolve as you expect! In this case try using
67- # $document_root instead.
68- fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
69- fastcgi_param DOCUMENT_ROOT $realpath_root;
70- # Prevents URIs that include the front controller. This will 404:
71- # http://domain.tld/index.php/some-path
72- # Remove the internal directive to allow URIs like this
73- internal;
74- }
58+ # When you are using symlinks to link the document root to the
59+ # current version of your application, you should pass the real
60+ # application path instead of the path to the symlink to PHP
61+ # FPM.
62+ # Otherwise, PHP's OPcache may not properly detect changes to
63+ # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
64+ # for more information).
65+ # Caveat: When PHP-FPM is hosted on a different machine from nginx
66+ # $realpath_root may not resolve as you expect! In this case try using
67+ # $document_root instead.
68+ fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
69+ fastcgi_param DOCUMENT_ROOT $realpath_root;
70+ # Prevents URIs that include the front controller. This will 404:
71+ # http://domain.tld/index.php/some-path
72+ # Remove the internal directive to allow URIs like this
73+ internal;
74+ }
7575
76- # return 404 for all other php files not matching the front controller
77- # this prevents access to other php files you don't want to be accessible.
78- location ~ \.php$ {
79- return 404;
80- }
81- #
82- # deny access to .htaccess vb. files, if Apache's document root
83- location ~/\. {
84- deny all;
85- log_not_found off;
86- }
87- #
88- location ~ /.well-known {
89- allow all;
90- }
91- #
92- location = /favicon.ico {
93- log_not_found off;
94- access_log off;
95- }
96- #
97- location = /robots.txt {
98- allow all;
99- log_not_found off;
100- access_log off;
101- }
102- #
103- access_log off;
104- error_log /var/log/nginx/${NGINX_HOST}.error.log error;
76+ # return 404 for all other php files not matching the front controller
77+ # this prevents access to other php files you don't want to be accessible.
78+ location ~ \.php$ {
79+ return 404;
80+ }
81+ #
82+ # deny access to .htaccess vb. files, if Apache's document root
83+ location ~/\. {
84+ deny all;
85+ log_not_found off;
86+ }
87+ #
88+ location ~ /.well-known {
89+ allow all;
90+ }
91+ #
92+ location = /favicon.ico {
93+ log_not_found off;
94+ access_log off;
95+ }
96+ #
97+ location = /robots.txt {
98+ allow all;
99+ log_not_found off;
100+ access_log off;
101+ }
102+ #
103+ access_log off;
104+ error_log /var/log/nginx/${NGINX_HOST}.error.log error;
105105}
0 commit comments