Skip to content

Instantly share code, notes, and snippets.

@cawa87
Created January 13, 2017 20:55
Show Gist options
  • Save cawa87/a78a2f17aaccf6c49c4638f66240f5cc to your computer and use it in GitHub Desktop.
Save cawa87/a78a2f17aaccf6c49c4638f66240f5cc to your computer and use it in GitHub Desktop.
NGINX area.baner-platform.local
server {
listen 80;
# Multiple hostnames separated by spaces. Replace these as well.
server_name area.baner-platform.local; # Alternately: _
root /home/cawa/www/baner_platform/area/public;
index index.php;
add_header Access-Control-Allow-Origin *;
# serve static files directly
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
access_log off;
expires max;
log_not_found off;
}
# removes trailing slashes (prevents SEO duplicate content issues)
# if (!-d $request_filename)
# {
# rewrite ^/(.+)/$ /$1 permanent;
# }
# # unless the request is for a valid file (image, js, css, etc.), send to bootstrap
# if (!-e $request_filename)
# {
# rewrite ^/(.*)$ /index.php?/$1 last;
# break;
# }
location / {
add_header Access-Control-Allow-Origin *;
try_files $uri $uri/ /index.php?$query_string;
}
location ~* \.php$ {
try_files $uri = 404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; #unix:/var/run/php5-fpm.sock; # /var/run/php/php7.0-fpm.sock
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment