I’m having problems getting friendly urls to work with my set up.
I’m using MODx Revolution v2.8.0 on a dedicated server powered by NGINX using Debian 10 and a Virtualmin control panel. I have used the Nginx Server Config found here: https://docs.modx.com/current/en/getting-started/friendly-urls/nginx, but it has not worked for me.
I set up an About Us resource page in Manager and can only see the page at /index.php?=2 (but only on Firefox - not on Google Chrome or Edge). I cannot see the page at /about
I’ve got Use Friendly URLs, Use Strict Friendly URLs and Use Friendly Alias Path all set to ‘Yes’. The below is my NGINX server config file. Can someone please take a look and suggest where they can see I am going wrong with this?
Here is my configuration file:
server {
listen 80;
server_name domain .com www.domain .com;
root /home/domain/public_html;
index index.php;
client_max_body_size 30M;
location / {
#root /home/domain/public_html;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_ignore_client_abort on;
fastcgi_param SERVER_NAME $http_host;
}
location ~ /\.ht {
deny all;
}
}
server {
server_name domain .com www.domain .com;
listen 00.0.000.000;
root /home/domain/public_html;
index index.html index.htm index.php;
client_max_body_size 30M;
access_log /var/log/virtualmin/domain.com_access_log;
error_log /var/log/virtualmin/domain.com_error_log;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME /home/domain/public_html$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT /home/domain/public_html;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS $https;
location ~ \.php(/|$) {
try_files $uri $fastcgi_script_name =404;
fastcgi_pass unix:/var/php-nginx/160000000000092.sock/socket;
}
fastcgi_split_path_info ^(.+\.php)(/.+)$;
listen 00.0.000.000:443 ssl;
ssl_certificate /home/domain/ssl.combined;
ssl_certificate_key /home/domain/ssl.key;
}