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

nginx and sub directory

#1
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!
 

HWS

Well-known member
#4
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.