Last active
April 11, 2018 06:35
-
-
Save anshuraj/c596663c6399d2249c999012f475411f to your computer and use it in GitHub Desktop.
nginx conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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