Last active
May 30, 2016 19:33
-
-
Save rahilwazir/96872155e78f6fd20ce43a10435f1b6b to your computer and use it in GitHub Desktop.
Nginx and PHP configuration on Windows
This file contains 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
... | |
client_max_body_size 256M; | |
#gzip on; | |
server { | |
listen 80; | |
server_name localhost; | |
root html; | |
#charset koi8-r; | |
#access_log logs/host.access.log main; | |
# For PHP Applications using Front_controller Pattern like, Yii, Laravel and WordPress for pretty permalinks | |
location / { | |
index index.html index.htm index.php; | |
try_files $uri $uri/ /index.php?$args; | |
} | |
location / { | |
root html; | |
index index.html index.php; | |
} | |
#error_page 404 /404.html; | |
# redirect server error pages to the static page /50x.html | |
# | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root html; | |
} | |
# proxy the PHP scripts to Apache listening on 127.0.0.1:80 | |
# | |
#location ~ \.php$ { | |
# proxy_pass http://127.0.0.1; | |
#} | |
location ~ \.php$ { | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
# deny access to .htaccess files, if Apache's document root | |
# concurs with nginx's one | |
# | |
#location ~ /\.ht { | |
# deny all; | |
#} | |
} | |
... |
This file contains 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
@ECHO OFF | |
start .\nginx.exe | |
start .\php\php-cgi.exe -b 127.0.0.1:9000 -c .\php\php.ini | |
ping 127.0.0.1 -n 1>NUL | |
echo Starting nginx | |
echo . | |
echo .. | |
echo ... | |
ping 127.0.0.1 >NUL | |
EXIT |
This file contains 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
@ECHO OFF | |
taskkill /f /IM nginx.exe | |
taskkill /f /IM php-cgi.exe | |
Exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment