Web Design

Setting up a website in Nginx


Simple config on how to get your site up and running and process php files (php-fpm)
Pretty straight forward, I'll get right into it.

Your nginx conf is in


but I won't focus on that.
You will need to look into the sites-available folder.

Also we will make the following assumptions:

  • You have ssh access.
  • Website: http://gibigbig.com
  • Default file: index.php
  • Absolute Path to site is /sites/gibigbig.com

make a file gibigbig in site-available

cd /etc/nginx/sites-available

touch gibigbig

Yes the ssh command is "touch" for creating a file. Don't ask.
Then open the file for editing.

pico gibigbig

and paste (copy the below config and right-slick into the ssh window.

Edit: I have to use pastebin because of issues with Ghost's markdown editor for code. Make sure you change the proper variables from the assumed variables mentioned earilier to yours.

Save the file by "writing out" of the pico editor by holding down the Ctrl and O buttons in windows. Confirm with Enter/Return button.

[Ctrl] + [O]


Next is to create a symbolic link to your new config file to your sites-enabled folder so nginx knows you want it enabled.

ln -s /etc/nginx/sites-available/gibigbig /etc/nginx/sites-enabled/gibigbig

And then just restart nginx:

service nginx restart

You can now access gibigbig.com
and process php files.