Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### NGINX CONFIGURATION
- server {
- listen 80;
- root /var/www/symfony-app/web;
- server_name symfony-app.dev www.symfony-app.dev;
- # setup CORS support for Api requests, and enable cache server support
- add_header 'Access-Control-Allow-Origin' '*' 'always';
- add_header 'Access-Control-Allow-Credentials' 'true' 'always';
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
- add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Accept';
- add_header 'Vary' 'Origin';
- location / {
- try_files $uri /app_dev.php$is_args$args;
- }
- location ~ ^/(app_dev|app|config)\.php(/|$) {
- fastcgi_pass php_fpm:9000;
- fastcgi_split_path_info ^(.+\.php)(/.*)$;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
- fastcgi_param DOCUMENT_ROOT $realpath_root;
- internal;
- }
- location ~ /.well-known {
- allow all;
- }
- error_log /var/log/nginx/symfony_app.dev_error.log;
- access_log /var/log/nginx/symfony_app.dev_access.log;
- }
- ### NELMIOCORS CONFIG
- nelmio_cors:
- defaults:
- allow_credentials: true
- allow_origin: ['*']
- allow_headers: ['Content-Type', 'Accept']
- allow_methods: ['POST', 'PUT', 'GET', 'DELETE', 'OPTIONS']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement