Answer the question
In order to leave comments, you need to log in
Why is the nginx rule not working?
Hello. Either I'm already melting from the heat or it really doesn't work.
server {
server_name example.com www.example.com;
listen 443 ssl http2;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
charset off;
index index.php index.html;
access_log /home/example/example.com/logs/access.nginx.log;
error_log /home/example/example.com/logs/error.nginx.log notice;
root /home/example/example.com/www/public;
location ^~ /static {
root /home/example/example.com/app;
}
location / {
include /etc/nginx/auth.conf;
try_files $uri $uri/ /index.php$is_args$args;
include /etc/nginx/include/example.com.con[f];
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/example.com.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ ^/assets/.*\.php$ {
deny all;
}
location ~* /\. {
deny all;
}
}
server {
server_name example.com www.example.com;
listen 443 ssl http2;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
charset off;
index index.php index.html;
access_log /home/example/example.com/logs/access.nginx.log;
error_log /home/example/example.com/logs/error.nginx.log notice;
root /home/example/example.com/www/public;
location /thing {
alias /home/example/example.com/app;
try_files $uri $uri/ /index.html$is_args$args;
}
location ^~ /static {
root /home/example/example.com/app;
}
location / {
include /etc/nginx/auth.conf;
try_files $uri $uri/ /index.php$is_args$args;
include /etc/nginx/include/example.com.con[f];
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/example.com.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ ^/assets/.*\.php$ {
deny all;
}
location ~* /\. {
deny all;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question