Last active
February 12, 2016 10:56
-
-
Save rakeshjames/75e557e60dbbaf9c38ce to your computer and use it in GitHub Desktop.
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; | |
root /srv/www/drupal8; | |
index index.php index.html index.htm; | |
server_name YOUR_SERVER_NAME.com; | |
location / { | |
try_files $uri @rewrite; | |
} | |
location @rewrite { | |
rewrite ^ /index.php; | |
} | |
error_page 404 /404.html; | |
error_page 403 /403.html; | |
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 | |
location ~ \.php$ { | |
try_files $uri $uri/ /index.php?q=$uri&$args; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
add_header Access-Control-Allow-Origin *; | |
proxy_set_header Access-Control-Allow-Origin $http_origin; | |
} | |
location ~ ^/sites/.*/files/styles/ { | |
try_files $uri @rewrite; | |
} | |
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml|js|htm|html)$ { | |
#access_log off; | |
#log_not_found off; | |
expires 360d; | |
#try_files $uri @rewrite; | |
} | |
location ~* \.(ttf|otf|eot)$ { | |
add_header Access-Control-Allow-Origin "*"; | |
} | |
# RSS Feed. | |
location = /rss.xml { | |
rewrite ^ /index.php?q=rss.xml; | |
} | |
# Sitemap Feed. | |
location = /sitemap.xml { | |
try_files $uri /index.php?q=sitemap.xml; | |
} | |
location ~ /\. { | |
access_log off; | |
log_not_found off; | |
deny all; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment