Want more timely Centmin Mod News Updates?
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

    3
    0
    1
    Oct 23, 2019
    Ratings:
    +1
    Local Time:
    7:55 PM
    1.19.0
    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

    44,731
    10,197
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,805
    Local Time:
    12:55 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  3. Veer

    Veer New Member

    3
    0
    1
    Oct 23, 2019
    Ratings:
    +1
    Local Time:
    7:55 PM
    1.19.0
    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.