-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathwebsite.conf
150 lines (128 loc) · 5.03 KB
/
website.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
server {
listen 8080;
server_name website.com;
rewrite / $scheme://www.$host$request_uri permanent; ## Forcibly prepend a www
}
server {
listen 8080 default;
## SSL directives might go here
#listen 443 default ssl;
#ssl_certificate /etc/nginx/conf.d/misstang_combined.crt;
#ssl_certificate_key /etc/nginx/conf.d/www.misstang.com.key;
## Domain is here twice so server_name_in_redirect will favour the www
server_name www.website.com;
root /var/www/vhosts/nginx-magento;
location / {
index index.php index.html; ## Allow a static html file to be shown first
try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
expires 30d; ## Assume all files are cachable
}
# Prevent robots
#location = /robots.txt {
#log_not_found off;
#}
# These locations would be hidden by .htaccess normally
location /app/ { deny all; }
location /includes/ { deny all; }
location /lib/ { deny all; }
location /media/downloadable/ { deny all; }
location /pkginfo/ { deny all; }
location /report/config.xml { deny all; }
location /var/ { deny all; }
# Add Expires headers
#location ~* "^.+\.(jpe?g|gif|css|png|js|ico|pdf|zip|tar|t?gz|mp3|wav|swf)$" {
#expires max;
#add_header Cache-Control public;
#}
location /var/export/ { ## Allow admins only to view export folder
auth_basic "Restricted"; ## Message shown in login window
auth_basic_user_file htpasswd; ## See /etc/nginx/htpasswd
autoindex on;
}
location /. { ## Disable .htaccess and other hidden files
return 404;
}
location @handler { ## Magento uses a common front handler
rewrite / /index.php;
}
location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
rewrite ^(.*.php)/ $1 last;
}
location ~ .php$ { ## Execute PHP scripts
if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
expires off; ## Do not cache dynamic content
fastcgi_pass 127.0.0.1:9000;
fastcgi_param HTTPS $fastcgi_https;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param MAGE_RUN_CODE default; ## Store code is defined in administration > Configuration > Manage Stores
fastcgi_param MAGE_RUN_TYPE store;
include fastcgi_params; ## See /etc/nginx/fastcgi_params
}
location ~ ^/cgi-bin/.*\.cgi$ { ## Execute CGI scripts
gzip off;
fastcgi_pass 127.0.0.1:8999;
fastcgi_index index.pl ;
fastcgi_param SCRIPT_FILENAME /usr/lib$fastcgi_script_name;
include fastcgi_params;
}
location ~ ^/phpmyadmin/ {
root /usr/share/phpmyadmin;
index index.php;
ccess_log off;
#error_log off;
charset utf-8;
}
# Awstats
#location ~ ^/awstats/ {
#root /data/webroot/awstats;
#index index.html;
#access_log off;
#error_log off;
#charset utf-8;
#}
# Memcached
#location ~* ^.+\.(jpg|jpeg|gif|css|png|js|xml)$ {
#expires 30d;
#access_log off;
#set $memcached_key $uri;
#memcached_pass 127.0.0.1:11211;
#}
# Prevent hotlinking
location ~* ^.+\.(jpg|jpeg|gif)$ {
valid_referers none blocked *.website.com www.website.com;
if ($invalid_referer) {
return 444; }
}
# Show resum stats
location /nginx_status {
#auth_basic "Restricted"; ## Message shown in login window
#auth_basic_user_file htpasswd; ## See /etc/nginx/htpasswd
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
# Munin
location ~ ^/www {
root /var/cache/munin/;
index index.html;
auth_basic "Restricted"; ## Message shown in login window
auth_basic_user_file htpasswd; ## See /etc/nginx/htpasswd
}
# PHP-FPM status
location = /status {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/default/www/html$fastcgi_script_name;
include fastcgi_params;
access_log off;
allow 127.0.0.1;
deny all;
}
# Fooman Speeder
#rewrite ^/minify/([0-9]+)(/.*.(js|css))$ /lib/minify/m.php?f=$2&d=$1 last;
#rewrite ^/skin/m/([0-9]+)(/.*.(js|css))$ /lib/minify/m.php?f=$2&d=$1 last;
#location /lib/minify/ {
#allow all;
#}
}