Skip to content

Instantly share code, notes, and snippets.

@anshuraj
Last active April 11, 2018 06:35
Show Gist options
  • Save anshuraj/c596663c6399d2249c999012f475411f to your computer and use it in GitHub Desktop.
Save anshuraj/c596663c6399d2249c999012f475411f to your computer and use it in GitHub Desktop.
nginx conf
server {
listen 80;
#listen 443 ssl;
root /path/to/project/;
server_name servername.com;
#ssl_certificate /etc/nginx/ssl/nginx.crt;
#ssl_certificate_key /etc/nginx/ssl/nginx.key;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
alias /path/to/project/;
try_files $uri $uri/ /index.html;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment