Created
June 4, 2014 12:58
-
-
Save andrewhl/d941fc88f9eea47bda19 to your computer and use it in GitHub Desktop.
I'm running Laravel on an AWS EC2 instance, and I'm trying to use Nginx. I get a 403 Forbidden HTTP response when I try to visit the public IP address.
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
server { | |
listen 80 default_server; | |
# listen [::]:80 default_server ipv6only=on; | |
root /home/ubuntu/public_html; | |
index index.html index.htm index.php; | |
# Make site accessible from http://localhost/ | |
server_name 54.23.4.31; | |
location / { | |
# First attempt to serve request as file, then | |
# as directory, then fall back to displaying a 404. | |
try_files $uri $uri/ /index.php$is_args$args; | |
# Uncomment to enable naxsi on this location | |
# include /etc/nginx/naxsi.rules | |
} | |
location ~ \.php$ { | |
try_files $uri /index.php =404; | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment