1server {
2 listen 80;
3 server_name example.com;
4 root /srv/example.com/public;
5
6 add_header X-Frame-Options "SAMEORIGIN";
7 add_header X-Content-Type-Options "nosniff";
8
9 index index.php;
10
11 charset utf-8;
12
13 location / {
14 try_files $uri $uri/ /index.php?$query_string;
15 }
16
17 location = /favicon.ico { access_log off; log_not_found off; }
18 location = /robots.txt { access_log off; log_not_found off; }
19
20 error_page 404 /index.php;
21
22 location ~ \.php$ {
23 fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
24 fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
25 include fastcgi_params;
26 }
27
28 location ~ /\.(?!well-known).* {
29 deny all;
30 }
31}
1# If you are using Nginx, the following directive in your site
2# configuration will direct all requests to the index.php
3# front controller:
4
5location / {
6 try_files $uri $uri/ /index.php?$query_string;
7}