Join the community today
Register Now

Xenforo XF fiendly URL's not working, is my configs correct?

Discussion in 'Forum software usage' started by PhoenixDown, Jun 16, 2014.

  1. PhoenixDown

    PhoenixDown New Member

    11
    0
    1
    Jun 16, 2014
    Ratings:
    +0
    Local Time:
    5:24 AM
    I am having the worst time trying to get the friendly URL's working probably on an a DO droplet install. Sorry if this is the wrong forum but looking for any pointers the group may have on what my issue might be. I suspect my configs are wrong though I believe I followed the instructions correctly several times now.

    Site: http://shinraonline.com/xen/


    File: /usr/local/nginx/conf/conf.d/shinraonline.com.conf

    Code:
    server {
      server_name shinraonline.com www.shinraonline.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;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/shinraonline.com/log/access.log combined buffer=32k;
      error_log /home/nginx/domains/shinraonline.com/log/error.log;
    
      root /home/nginx/domains/shinraonline.com/public;
    
      location / {
    
    
      }
    
    # My Edit
    
      location /xen/ {
      index index.php index.html index.htm;
      try_files $uri $uri/ /index.php?$uri&$args;
    
      }
    
      location /xen/internal_data/ {
      internal;
      allow 127.0.0.1;
      deny all;
      }
    
      location /xen/library/ {
      internal;
      allow 127.0.0.1;
      deny all;
      }
    
    
    
    location ~ \.php$ {
      try_files $uri =404;
      fastcgi_pass  127.0.0.1:9000;
      fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
      include  fastcgi_params;
    }
    
    
    # End My Edit
    
    
    
      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;
    }
    
    


    file: /usr/local/nginx/conf/php.conf


    Code:
    location ~ \.php$ {
        try_files $uri =404;
         fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass   127.0.0.1:9000;
        #fastcgi_pass   unix:/tmp/php5-fpm.sock;
        fastcgi_index  index.php;
        #fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  SCRIPT_FILENAME    $request_filename;
    
    fastcgi_connect_timeout 60;
    fastcgi_send_timeout 180;
    fastcgi_read_timeout 180;
    fastcgi_buffer_size 512k;
    fastcgi_buffers 512 16k;
    fastcgi_busy_buffers_size 512k;
    fastcgi_temp_file_write_size 512k;
    fastcgi_intercept_errors on;
    
    # old pre .03 method
    #fastcgi_param HTTPS on;
    
    #new .04+ map method
    fastcgi_param HTTPS $server_https;
    
    
    # comment out PATH_TRANSLATED line if /usr/local/lib/php.ini sets following:
    # cgi.fix_pathinfo=0
    # as of centminmod v1.2.3-eva2000.01 default is set to cgi.fix_pathinfo=1
    
    fastcgi_param  PATH_INFO          $fastcgi_path_info;
    fastcgi_param  PATH_TRANSLATED    $document_root$fastcgi_path_info;
    
    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_NAME        $fastcgi_script_name;
    fastcgi_param  REQUEST_URI        $request_uri;
    fastcgi_param  DOCUMENT_URI       $document_uri;
    fastcgi_param  DOCUMENT_ROOT      $document_root;
    fastcgi_param  SERVER_PROTOCOL    $server_protocol;
    
    fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
    fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
    
    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;
    
    # PHP only, required if PHP was built with --enable-force-cgi-redirect
    fastcgi_param  REDIRECT_STATUS    200;
    
                       }
    
    
     
  2. eva2000

    eva2000 Administrator Staff Member

    29,033
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    7:24 PM
    Nginx 1.13.x
    MariaDB 5.5
    @PhoenixDown moved your thread to Forum usage forums https://community.centminmod.com/forums/forum-software-usage.34/ :)

    Just remove the duplicate php location context match you have

    Code:
    location ~ \.php$ {
      try_files $uri =404;
      fastcgi_pass  127.0.0.1:9000;
      fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
      include  fastcgi_params;
    }
    that is already set in your vhost's include file at /usr/local/nginx/conf/php.conf

    Then restart Nginx server
     
  3. eva2000

    eva2000 Administrator Staff Member

    29,033
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    7:24 PM
    Nginx 1.13.x
    MariaDB 5.5
    oh missed it , you need to add /xen in front of

    Code:
    /xen/index.php?$uri&$args;
    Code:
      location /xen/ {
      index index.php index.html index.htm;
      try_files $uri $uri/ /xen/index.php?$uri&$args;
    
      }
     
    • Like Like x 1
  4. PhoenixDown

    PhoenixDown New Member

    11
    0
    1
    Jun 16, 2014
    Ratings:
    +0
    Local Time:
    5:24 AM
    That last part seemed to do the trick, much appreciated :)
     
  5. PhoenixDown

    PhoenixDown New Member

    11
    0
    1
    Jun 16, 2014
    Ratings:
    +0
    Local Time:
    5:24 AM
    My current config for those interested:

    Code:
    server {
      server_name shinraonline.com www.shinraonline.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;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/shinraonline.com/log/access.log combined buffe$
      error_log /home/nginx/domains/shinraonline.com/log/error.log;
    
      root /home/nginx/domains/shinraonline.com/public;
    
      location / {
    
      }
    
    # My Edit
    
      location /xen/ {
      index index.php index.html index.htm;
      try_files $uri $uri/ /xen/index.php?$uri&$args;
    
      }
    
      location /xen/internal_data/ {
      internal;
      allow 127.0.0.1;
      deny all;
      }
    
      location /xen/library/ {
      internal;
      allow 127.0.0.1;
      deny all;
      }
    
    # End My Edit
    
    
      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;
    }