Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- server_name localhost;
- index index.php index.html;
- root /app/public;
- location / {
- try_files $uri /index.php$is_args$args;
- # https://stackoverflow.com/questions/31493634/laravel-routes-not-found-on-nginx
- #try_files $uri $uri/ /index.php?$query_string;
- # Simple requests
- if ($request_method ~* "(GET|POST)") {
- add_header "Access-Control-Allow-Origin" * always;
- }
- # Preflighted requests
- if ($request_method = OPTIONS ) {
- #add_header "Access-Control-Allow-Origin" * always;
- add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS, HEAD";
- add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept";
- return 200;
- }
- }
- location ~ ^/index\.php(/|$) {
- try_files $uri =404;
- # https://stackoverflow.com/questions/31493634/laravel-routes-not-found-on-nginx
- #try_files $uri $uri/ /index.php?$query_string;
- fastcgi_split_path_info ^(.+\.php)(/.*)$;
- fastcgi_pass laravel_vue_companies_php:9000;
- fastcgi_index index.php;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- # Simple requests
- if ($request_method ~* "(GET|POST)") {
- #add_header "Access-Control-Allow-Origin" * always;
- }
- # Preflighted requests
- if ($request_method = OPTIONS ) {
- #add_header "Access-Control-Allow-Origin" * always;
- add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS, HEAD";
- add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept";
- return 200;
- }
- }
- location ~ \.php$ {
- return 404;
- }
- error_log /var/log/nginx/error.log;
- access_log /var/log/nginx/access.log;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement