Member page inaccessible NGINX - Friendly URLs

rkxh

Member
Hello everyone, I oddly run into the issue that friendly URLs are only partially working with NGINX and friendly URLs enabled.
Here is the config, which matches the docs:
NGINX:
server {
    listen 80;
    server_name www.forum.tld forum.tld;
    
    if ($host = www.forum.tld) {
        return 301 https://forum.tld$request_uri;
    } # managed by Certbot

    if ($host = forum.tld) {
        return 301 https://forum.tld$request_uri;
    } # managed by Certbot
}


server {
        listen 443 ssl;
        server_name www.forum.tld forum.tld;

        # HTTP Headers
        http2 on;

    #Logs
        access_log off;
        error_log off;

        root /home/forum;

    # Headers
    add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
    add_header X-Content-Type-Options nosniff;

        # SSL
        ssl_certificate /etc/letsencrypt/live/forum/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/forum/privkey.pem; # managed by Certbot
        ssl_trusted_certificate /etc/letsencrypt/live/forum/fullchain.pem;
        ssl_dhparam /etc/nginx/ssl/dhparam.pem;
        ssl_session_cache shared:SSL:10m;
        ssl_session_timeout 1d;
        ssl_prefer_server_ciphers on;
        ssl_protocols TLSv1.2 TLSv1.3;
        ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
        resolver 8.8.8.8 8.8.4.4;

    # PageSpeed
    pagespeed off;

    # Rewrites
        location / {
                try_files $uri $uri/ /index.php?$uri&$args;
        index index.php index.html;
        }

           location ^~ /install/data/ {
               internal;
           }

    location ^~ /install/templates/ {
            internal;
    }

    location ^~ /internal_data/ {
        internal;
    }

    location ^~ /library/ {
            internal;
    }

    location ^~ /src/ {
            internal;
    }


        # PHP-FPM
        location ~ \.php$ {
    try_files $uri =404;
        fastcgi_pass unix:/run/php/php8.2-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
        }

}

I am not sure if this is caused by the recent change from the www. sub-domain to non-www.
Board URL was changed from http:// to https:// as well, which should be fine?
 
Thanks for that, but first of all I do not use any panels nor does their config differ from mine.
I genuinely start to think that something isn't right with either the files or the database.
 
I genuinely start to think that something isn't right with either the files or the database.
There's not really anything in the DB or files which could cause whatever the problems is - you only said it's inaccessible without clarifying any error message or response code.

Rewrites and redirection are server side functions.

We use NGINX on this site and on all Cloud sites, with FURLs enabled, without issue.
 
I temporarily solved this by setting up a dedicated route for /members.
This is probably some post upgrade stuff (we upgraded all the way from 1.5.X to 2.2.15.

@Paul B the issue is that /members redirects you back to the start page of the forum.
However, you are able to visit /members/list for instance, just not /members and any query associated to it.

Logs are empty.
 
There's nothing in XF which would cause that.

I would be looking at server side redirects.
 
There's nothing in XF which would cause that.

I would be looking at server side redirects.
Server is clean as silk. Fresh install, no other hosts active. This is literally the only config I have loaded.
Here the nginx.conf:
NGINX:
user  www-data;
worker_processes auto;
worker_rlimit_nofile 100000;
pid /run/nginx.pid;

events {
    worker_connections  65535;
    use epoll;
    multi_accept on;
    accept_mutex on;
}

http {
    # MIMEs
    include       mime.types;
    default_type  application/octet-stream;

    # General
    server_tokens off;
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    reset_timedout_connection on;
    types_hash_max_size    2048;
    types_hash_bucket_size 64;

    # Upload
    client_max_body_size    100M;

    # Buffers
    client_body_buffer_size 1m;
    client_body_in_single_buffer on;
    client_header_buffer_size 1k;
    large_client_header_buffers 4 16k;

    # Logging
    access_log  off;
    error_log   off;

    # Include
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}
conf.d is empty and sites-enabled only contains the config file from above.
 
Solved - apparently there was some directory called "members". 🤦‍♂️
I am sorry, but this is an extremely old installation - formerly vB 4, then stuck on XF 1.3 for +10 years.
God knows what is all in there.

Removed all unused files and directories, so something silly like this shouldn't happen again.
 
Last edited:
That has come up before but so rarely that I completely forgot about it.

The same would happen for any other routes if there were named directories on the server.

Glad to hear it's resolved.
 
Back
Top Bottom