-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
170 lines (150 loc) · 6.99 KB
/
nginx.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#server {
# listen 80;
# server_name www.buildzar.com;
# rewrite / $scheme://$host$request_uri permanent; ## Forcibly prepend a www
#}
server {
listen 80;
## SSL directives might go here
server_name www.buildzar.com ; ## Domain is here twice so server_name_in_redirect will favour the www
root /var/www/html/work/my-branch;
include /etc/nginx/sites-enabled/redirect.conf;
set $my_http "http";
set $my_ssl "off";
set $my_port "80";
if ($http_x_forwarded_proto = "SSL") {
set $my_http "https";
set $my_ssl "on";
set $my_port "443";
}
location /nginx_status {
# Turn on stats
stub_status on;
access_log off;
# only allow access from 192.168.1.5 #
allow all;
}
location /above-5000.html {
rewrite ^(.*)$ /watches-clearance-sale/above-5000.html redirect;
}
location / {
index index.html index.php; ## 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; ##
rewrite "^/solitaires.html$" http://solitaires.jewelskart.com/ redirect;
rewrite "^/solitaires/solitaires-diamonds.html$" http://solitaires.jewelskart.com/ redirect;
rewrite "^/accu-reader-ar8-011-gunmetal-c1-reading-eyeglasses-only-for-plus-power.html$" http://www.lenskart.com redirect;
rewrite "^/sunglasses/special/big-bang.html$" http://www.lenskart.com/sunglasses/collections/aviators-wayfarers.html redirect;
if ($http_host ~* "^buildzar\.com$"){
rewrite ^(.*)$ http://www.buildzar.com/$1 redirect;
}
rewrite "^/home$" http://www.buildzar.com redirect;
#rewrite "^/index.php/admin*" http://www.lenskart.com redirect;
#rewrite "^/admin$" http://www.lenskart.com/ redirect;
rewrite "^/downloader/$" http://www.lenskart.com/ redirect;
#rewrite "^/admin/$" http://www.lenskart.com/ redirect;
rewrite "^/mobile$" http://www.lenskart.com/ redirect;
rewrite "^/akshaya-tritiya-offers-2014$" http://www.jewelskart.com/latest-offers.html redirect;
rewrite "^/eyeglasses/popular-searches/try-before-you-buy.html$" http://www.lenskart.com/eyeglasses/popular-searches/try-before-you-buy-tbyb.html redirect;
rewrite "^/eyeglasses/popular-searches/tbyb.html$" http://www.lenskart.com/try-before-you-buy redirect;
rewrite "^/valentine/gift-for-her/women-jewellery.html$" http://www.jewelskart.com/jewellery-gifts/valentine-gift-jewelskart/women-jewellery.html redirect;
rewrite "^/valentine/gift-for-her/women-sunglasses.html$" http://www.lenskart.com/sunglasses/valentine-gift-lenskart/women-sunglasses.html redirect;
rewrite "^/power-sunglasses-main/what-is-power-sunglasses.html$" http://www.lenskart.com/faq/prescription-sunglasses redirect;
rewrite "^/valentine/gift-for-her/women-bags.html$" http://www.bagskart.com/gift-ideas/valentine-gift-bagskart/women-bags.html redirect;
rewrite "^/valentine/gift-for-him/men-jewellery.html$" http://www.jewelskart.com/jewellery-gifts/valentine-gift-jewelskart/men-jewellery.html redirect;
rewrite "^/valentine/gift-for-him/men-bags.html$" http://www.bagskart.com/gift-ideas/valentine-gift-bagskart/men-bags.html redirect;
rewrite "^/valentine/gift-for-him/men-sunglasses.html$" http://www.lenskart.com/sunglasses/valentine-gift-lenskart/men-sunglasses.html redirect;
rewrite "^/parim$" http://www.lenskart.com/sunglasses/brands/parim-sunglasses.html redirect;
rewrite "^/freeframe$" http://www.lenskart.com/eyeglasses/popular-searches/first-pair-free.html redirect;
rewrite "^/eyeglasses/material/titanium.html$" http://www.lenskart.com/eyeglasses/temple-material/titanium.html redirect;
rewrite "^/gift-voucher-86630.html$" /catalog/product/view/id/86605 redirect;
rewrite "^/gift-voucher-86632.html$" /catalog/product/view/id/86605 redirect;
rewrite "^/gift-voucher.html$" /catalog/product/view/id/86605 redirect;
}
#mobile-site-redirect
rewrite "^/sahi$" "http://www.lenskart.com/" redirect;
location = /sitemap.xml {
rewrite ^(.*)$ /sitemap/lenskart/sitemap.xml break;
rewrite ^(.*)$ /sitemap/bagskart/sitemap.xml break;
rewrite ^(.*)$ /sitemap/watchkart/sitemap.xml break;
rewrite ^(.*)$ /sitemap/jewelskart/sitemap.xml break;
rewrite ^(.*)$ /sitemap/john-jacobs/sitemap.xml break;
rewrite ^(.*)$ /sitemap/lenskart.sg/sitemap.xml break;
}
location = /BingSiteAuth.xml {
rewrite ^(.*)$ /sitemap/lenskart/BingSiteAuth_LK.xml break;
rewrite ^(.*)$ /sitemap/bagskart/BingSiteAuth_BK.xml break;
rewrite ^(.*)$ /sitemap/watchkart/BingSiteAuth_WK.xml break;
rewrite ^(.*)$ /sitemap/jewelskart/BingSiteAuth_JK.xml break;
rewrite ^(.*)$ /sitemap/john-jacobs/BingSiteAuth_jj.xml break;
rewrite ^(.*)$ /sitemap/lenskart.sg/BingSiteAuth_sg.xml break;
}
location = /sunglasses {
rewrite ^(.*)$ /sunglasses.html redirect;
}
location = /sunglasses/ {
rewrite ^(.*)$ /sunglasses.html redirect;
}
location = /eyeglasses {
rewrite ^(.*)$ /eyeglasses.html redirect;
}
location = /eyeglasses/ {
rewrite ^(.*)$ /eyeglasses.html redirect;
}
location = /buyonegiveone11.html {
rewrite ^(.*)$ /buyonegiveone/index.php redirect;
}
location = /robots.txt {
rewrite ^(.*)$ /robots_watch.txt break;
rewrite ^(.*)$ /robots_bags.txt break;
rewrite ^(.*)$ /robots_jewels.txt break;
rewrite ^(.*)$ /robots_jj.txt break;
rewrite ^(.*)$ /robots_sg.txt break;
}
location ~ /(media|skin|js)/ {
}
location /api/v2_soap {
rewrite ^/api/v2_soap /index.php/api;
}
location /api {
rewrite ^/api/rest /api.php?type=rest break;
}
#location /api {
#rewrite ^/api /index.php/api break;
#}
## 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; }
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/htpassword
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
fastcgi_buffers 256 16k;
fastcgi_param HTTPS $my_ssl;
expires off; ## Do not cache dynamic content
# fastcgi_pass unix:/var/run/php5-fpm/www.socket;
fastcgi_pass 127.0.0.1:9000;
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
fastcgi_read_timeout 300;
}
}