是否可以为Ngnix重写下一个Apache指令?
Apache:
AddDefaultCharset UTF-8
的Apache:
<IfModule mod_rewrite.c\>
Options +Followsymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com [OR]
RewriteCond %{HTTP_HOST} ^domain2\.com [OR]
RewriteCond %{HTTP_HOST} ^www\.domain2\.com
RewriteRule ^(.*)$ http://www.domain2.com/$1 [R=301,L]
</IfModule>
Header set Cache-Control "public"
Header set Expires "Fri, 4 Jan 2022 20:00:00 GMT"
FileETag None
的Apache:
AddOutputFilterByType DEFLATE text/css
答案 0 :(得分:0)
1
charset utf8;
2
server {
server_name domain.com;
server_name domain2.com;
server_name www.domain.com; # www.domain2.com in RewriteCond, you mean www.domain.com?
return 301 $scheme://www.domain2.com/$request_uri;
}
3
expires max;
4
gzip on