Skip to content

Instantly share code, notes, and snippets.

@skpaul82
Last active May 17, 2018 10:11
Show Gist options
  • Save skpaul82/ed309b64da80a8baf7ea204251c44321 to your computer and use it in GitHub Desktop.
Save skpaul82/ed309b64da80a8baf7ea204251c44321 to your computer and use it in GitHub Desktop.
Ubuntu and nginx server setup.
server {
listen 80; # port 80 default
root /home/ubuntu/www/evoneur/public; # default directory where the files will be stored and served from
index index.php index.html index.htm; # index defined to be served under directory
server_name mainserver.com; #name of the virtual host or domain
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location / {
try_files $uri $uri/ @rewrite;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /home/ubuntu/www/evoneur/public;
}
# Serve PHP scripts to FastCGI server our php-fpm server listening on 127.0.0.1:9000
location ~ \.php$ {
#fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment