-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaravel.conf
executable file
·80 lines (63 loc) · 1.86 KB
/
laravel.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
upstream backend {
# no load balancing method is specified for Round Robin
#ip_hash;
server php:9000 max_fails=3 fail_timeout=30s;
#server php2:9000 max_fails=3 fail_timeout=30s;
#server php3:9000 max_fails=3 fail_timeout=30s;
#server app-2.dennys_development-network:8002 max_fails=3 fail_timeout=30s;
# server app-3:8003 max_fails=3 fail_timeout=30s;
}
server {
listen 8000 default_server;
listen [::]:8000 default_server ipv6only=on;
server_name localhost;
access_log /srv/access.log;
error_log /srv/error.log;
root /opt/public;
index index.php index.html;
# 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;
}
# enforce NO www
if ($host ~* ^www\.(.*))
{
set $host_without_www $1;
rewrite ^/(.*)$ $scheme://$host_without_www/$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 / {
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-fpm.sock; # may also be: 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# include fastcgi_params;
# }
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass backend;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}