Join the community today
Become a Member

Xenforo XenForo Friendly Urls not working

Discussion in 'Forum software usage' started by Veer, Jul 8, 2020.

  1. Veer

    Veer New Member

    10
    0
    1
    Oct 23, 2019
    Ratings:
    +1
    Local Time:
    7:10 PM
    1.19.1
    10.3.23
    I have XF rewrites in my domain config, but friendly urls are not working, 404 Not Found Error. Any idea what I'm missing?

    Here is my domain config file:
    Code:
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    server {
                listen   80;
                server_name domain.com;
                return 301 $scheme://www.domain.com$request_uri;
           }
    
    server {
    
      server_name www.domain.com;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      #add_header X-Frame-Options SAMEORIGIN;
      add_header X-Xss-Protection "1; mode=block" always;
      add_header X-Content-Type-Options "nosniff" always;
      #add_header Referrer-Policy "strict-origin-when-cross-origin";
      #add_header Feature-Policy "accelerometer 'none'; camera 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; payment 'none'; usb 'none'";
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/domain.com/log/access.log combined buffer=256k flush=5m;
      error_log /home/nginx/domains/domain.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf;
      root /home/nginx/domains/domain.com/public;
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      # prevent access to ./directories and files
      #location ~ (?:^|/)\. {
      # deny all;
      #}
    
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
     
      ### Start Xenforo
        location / {
    
            index index.php index.html;
            try_files $uri $uri/ /index.php?$uri&$args;
       
        }    
    
        location /internal_data/ {
            internal;
        }
       
        location /install/templates/ {
            internal;
        }
    
        location /library/ {
            internal;
        }
       
        location /src/ {
            internal;
        }
    
        location /install/ {
            auth_basic "Private";
            auth_basic_user_file /usr/local/nginx/conf/htpasswd_admin_php;
                include /usr/local/nginx/conf/php.conf;
        }
    
        location ~ ^/(admin.php) {
            auth_basic "Private";
            auth_basic_user_file /usr/local/nginx/conf/htpasswd_admin_php;
                include /usr/local/nginx/conf/php.conf;
        }
      
        ### End Xenforo
    
    # block common exploits, sql injections etc
    #include /usr/local/nginx/conf/block.conf;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # Shows file listing times as local time
      #autoindex_localtime on;
    
      # Wordpress Permalinks example
      #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      }
    
      include /usr/local/nginx/conf/pre-staticfiles-local-domain.com.conf;
      include /usr/local/nginx/conf/pre-staticfiles-global.conf;
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
     
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    
    • CentOS Version: CentOS 7
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed: 1.19.0
    • PHP Version Installed: 7.0.33
    • CloudFlare SSL : Full


     
    Last edited: Jul 8, 2020
  2. eva2000

    eva2000 Administrator Staff Member

    55,248
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,833
    Local Time:
    12:10 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  3. Veer

    Veer New Member

    10
    0
    1
    Oct 23, 2019
    Ratings:
    +1
    Local Time:
    7:10 PM
    1.19.1
    10.3.23
    Thanks, I added the rewrites lines in /usr/local/nginx/conf/conf.d/domain.com.ssl.conf and it started working. I thought those lines are enough on /usr/local/nginx/conf/conf.d/domain.com.conf file only.