Created
December 14, 2018 17:55
-
-
Save VirtuBox/9e485a800a460b1a1631d46159967171 to your computer and use it in GitHub Desktop.
Nginx PHP upstream
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
http { | |
--- | |
# php upstream | |
upstream php { | |
server unix:/var/run/php/php7.2-fpm.sock; | |
} | |
--- | |
server { | |
server_name yourdomain.tld; | |
root /var/www/yoursite.tld/htdocs; | |
index index.php index.html; | |
location / { | |
try_files $uri $uri/ /index.php?$args; | |
} | |
# pass request to php upstream | |
# if file exist | |
location ~ \.php$ { | |
try_files $uri =404; | |
include fastcgi_params; | |
fastcgi_pass php; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment