Want to subscribe to topics you're interested in?
Become a Member

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:
    9:20 PM
    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

    53,554
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    11:20 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    @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

    53,554
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    11:20 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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;
    
      }
     
  4. PhoenixDown

    PhoenixDown New Member

    11
    0
    1
    Jun 16, 2014
    Ratings:
    +0
    Local Time:
    9:20 PM
    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:
    9:20 PM
    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;
    }