1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Moving Xenforo from Apache to Nginx Causing some odd errors.

Discussion in 'Troubleshooting and Problems' started by Kane Hart, Sep 22, 2014.

  1. Kane Hart

    Kane Hart Active Member

    So I'm no expert with rewrite rules but I assume since I'm using only one site I changed my /etc/nginx/sites-available/default file.

    Anyways when I go to the page with the rewrite rules from the xenforo page I get this odd error An error occurred.

    Now if I remove all the location or left the default location information the forums work just fine well besides anything but the index works since I had enabled the rewrites via the admin panel before I switched over. But I want to keep friendly URL's etc.

    Code:
    server {
      listen 80 default_server;
      listen [::]:80 default_server ipv6only=on;
      root /home/special/public_html;
      index index.php index.html index.htm;
      # Make site accessible from http://localhost/
      server_name special.net;
    location /home/special/public_html/ {
      try_files $uri $uri/ /home/special/public_html/index.php?$uri&$args;
      index index.php index.html;
    }
    location /home/special/public_html/internal_data/ {
      internal;
    }
    location /home/special/public_html/library/ {
      internal;
    }
    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;
    }
    
     
  2. Sheratan

    Sheratan Well-Known Member

    I don't remember xf need to have this kind of configuration
     
  3. Kane Hart

    Kane Hart Active Member

  4. Kane Hart

    Kane Hart Active Member

    Double Post ohh I'm bad. Solved it with this little bit. I guess doing full path and such was a bad idea.

    Code:
      location / {
      index index.php index.html index.htm;
      try_files $uri $uri/ /index.php?$uri&$args;
    
      }
    
      location /internal_data/ {
      internal;
      allow 127.0.0.1;
      deny all;
      }
    
      location /library/ {
      internal;
      allow 127.0.0.1;
      deny all;
      }
     

Share This Page