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

nginx and sub directory

Discussion in 'Installation, Upgrade, and Import Support' started by Infuscu, Feb 19, 2013.

  1. Infuscu

    Infuscu Member

    Hello,

    I should first mention that I am totally new to everything related to nginx (and hosting in general).

    I am trying to install XenForo on Ubuntu 12.04 with nginx and php-fpm installed. I am not getting far before I encounter problems. I've read around several threads trying to figure out what I am doing wrong but I reckon my primary problem lies within the nginx configuration. I might be missing something essential - as the general structure or something else ..

    Anyway, this is my folder structure:
    Code:
    /opt/www/forum/<xenforo>
    nginx config:
    http://pastebin.com/ip96k3CX

    I am receiving "502 Bad Gateway" when I try to reach anything on the domain (http://192.81.222.209).

    Urgh! What am I doing wrong here? :)

    Thanks!
     
  2. HWS

    HWS Well-Known Member

    Most likely "unix:/tmp/php.socket;" isn't there.

    Make sure you route PHP requests to php-fpm correctly.
     
  3. Infuscu

    Infuscu Member

    Thanks for the reply.

    I am not entirely sure what you mean. Isn't line 16 what you're referring to?
     
  4. HWS

    HWS Well-Known Member

    In your nginx.conf you route all php requests to the unix socket "/tmp/php.socket". The gateway error means that this socket cannot be found or cannot be used.

    Since you've installed php-fpm: Find it's socket file and route to it correctly in nginx.conf. Or alternatively do not use the socket and route requests via TCP to the php-fpm localhost listener URL.
     
  5. Infuscu

    Infuscu Member

    I got it working! It was indeed the routing which was incorrect :)

    Now I just gotta understand it .. seems like a complex world.

    Thanks!
     
    SneakyDave likes this.

Share This Page