generated from ibrunotome/laravel-api-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.develop.conf
101 lines (84 loc) · 3.53 KB
/
nginx.develop.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
worker_processes 1;
events {
worker_connections 4096;
multi_accept on;
use epoll;
}
http {
include mime.types;
server_tokens off;
default_type application/octet-stream;
client_body_buffer_size 10K;
client_header_buffer_size 1k;
client_max_body_size 10m;
large_client_header_buffers 4 16k;
access_log off;
error_log /dev/stderr;
sendfile on;
keepalive_timeout 15;
keepalive_requests 10000;
server {
listen 80;
index index.php index.html;
root /var/www/public;
add_header 'Access-Control-Allow-Origin:' '*' 'always';
add_header 'Access-Control-Allow-Credentials:' 'true' 'always';
add_header 'Access-Control-Allow-Methods:' 'GET, HEAD, POST, PUT, PATCH' 'always';
add_header 'Access-Control-Allow-Headers:' 'Authorization, Cache-Control, Content-Type, Keep-Alive, Origin, X-Requested-With' 'always';
add_header 'Referrer-Policy' 'same-origin';
add_header 'Feature-Policy' "geolocation 'none'; vibrate 'none'";
add_header 'Strict-Transport-Security' 'max-age=31536000; includeSubdomains; preload';
add_header 'X-Content-Type-Options' 'nosniff';
add_header 'X-Frame-Options' 'SAMEORIGIN';
add_header 'X-XSS-Protection' '1; mode=block';
gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
location ~* \.(js|jpg|jpeg|gif|png|css|tgz|gz|rar|bz2|doc|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|woff|woff2|svg)$ {
expires 365d;
access_log off;
etag on;
if_modified_since exact;
add_header Pragma "public";
add_header Cache-Control "max-age=31536000, public";
add_header Access-Control-Allow-Origin *;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_read_timeout 180;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
error_page 503 @503_json;
error_page 502 @502_json;
error_page 500 @500_json;
error_page 404 @404_json;
location @503_json {
return 503 '{"data": {"message": "The server is temporary unable to serve your request"}, "meta": {"timestamp": $msec}}';
}
location @502_json {
return 502 '{"data": {"message": "The server encountered a temporary error and could not complete your request"}, "meta": {"timestamp": $msec}}';
}
location @500_json {
return 500 '{"data": {"message": "There was an error. Please try again later"}, "meta": {"timestamp": $msec}}';
}
location @404_json {
return 404 '{"data": {"message": "The requested resource was not found"}, "meta": {"timestamp": $msec}}';
}
}
}