Skip to content

Instantly share code, notes, and snippets.

@carlosfilho88
Last active May 25, 2021 19:49
Show Gist options
  • Save carlosfilho88/2405b12ac9c43b0b7170 to your computer and use it in GitHub Desktop.
Save carlosfilho88/2405b12ac9c43b0b7170 to your computer and use it in GitHub Desktop.
NovoSGA nginx configs
## nginx 1.8.0
server {
listen 80;
server_name FQND;
root /var/www/novosga/public;
index index.php;
## Enable CORS
#add_header Access-Control-Allow-Origin *;
#add_header Access-Control-Allow-Credentials true;
#add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,OPTIONS;
#add_header Access-Control-Allow-Headers DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization;
location /api {
try_files $uri $uri/ /api/index.php?$args;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~* \.php$ {
try_files $uri @api;
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