Created
December 11, 2014 21:57
-
-
Save neo22s/a7a89cef6f33a116c7cc to your computer and use it in GitHub Desktop.
nginx config for Open Classifieds
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 [::]:80; | |
server_name | |
yourdomain.com | |
; | |
root /var/www/openclassifieds; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
index index.php; | |
# Don't serve hidden files. | |
location ~ /\. { | |
deny all; | |
} | |
location = /favicon.ico { | |
log_not_found off; | |
} | |
location / | |
{ | |
try_files $uri /index.php?$args; | |
} | |
location ~ \.php$ { | |
include fastcgi_params; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param KOHANA_ENV PRODUCTION; | |
# YOU MUST REPLACE 12345 with your app's PHP FPM port number | |
############################################################ | |
fastcgi_pass 127.0.0.1:10815; | |
# Prevent arbitrary code execution by third parties with | |
# try_files directive. | |
# http://wiki.nginx.org/Pitfalls#Passing_Uncontrolled_Requests_to_PHP | |
try_files $uri =404; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 14 should be moved to the last line of the file.