devhops
Member
Hi,
I've had the oh so common friendly URL's 404. The homepage works, but any other URL I click 404's. I'm running nginx and php-fpm on CentOS.
I know it's something in the nginx conf file that I've set incorrectly or overlooked, but I can't identify it. Can anyone help? Here is my config file.
I've had the oh so common friendly URL's 404. The homepage works, but any other URL I click 404's. I'm running nginx and php-fpm on CentOS.
I know it's something in the nginx conf file that I've set incorrectly or overlooked, but I can't identify it. Can anyone help? Here is my config file.
NGINX:
server {
listen 80;
server_name mydomain.com www.mydomain.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
if ($scheme != "https") {
return 301 https://$host$request_uri;
} # managed by Certbot
root /data/mydomain;
index index.php index.html index.htm;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location /data/mydomain {
try_files $uri $uri/ /data/mydomain/index.php?$uri&$args;
index index.php index.html;
}
location /data/mydomain/install/data/ {
internal;
}
location /data/mydomain/install/templates/ {
internal;
}
location /data/mydomain/internal_data/ {
internal;
}
location /data/mydomain/library/ {
}
location /data/mydomain/install/templates/ {
internal;
}
location /data/mydomain/internal_data/ {
internal;
}
location /data/mydomain/library/ {
internal;
}
location ~ \.php$ {
root /data/mydomain;
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}