{"id":61750,"date":"2020-04-08T06:03:52","date_gmt":"2020-04-07T22:03:52","guid":{"rendered":"http:\/\/4563.org\/?p=61750"},"modified":"2020-04-08T06:03:52","modified_gmt":"2020-04-07T22:03:52","slug":"%e5%8f%88%e6%9d%a5%e8%af%b7%e6%95%99-htaccess%e8%bd%acnginx%e7%9a%84%e9%97%ae%e9%a2%98%e4%ba%86%ef%bc%8c%e4%be%9d%e7%84%b6%e6%80%a5%e6%b1%82%e5%9c%a8%e7%ba%bf%e7%ad%89","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=61750","title":{"rendered":"\u53c8\u6765\u8bf7\u6559.htaccess\u8f6cnginx\u7684\u95ee\u9898\u4e86\uff0c\u4f9d\u7136\u6025\u6c42\u5728\u7ebf\u7b49"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>\u83dc\u82b1\u5927\u76d7<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-3-19 16:30:37\t<\/p>\n<h3>\u53c8\u6765\u8bf7\u6559.htaccess\u8f6cnginx\u7684\u95ee\u9898\u4e86\uff0c\u4f9d\u7136\u6025\u6c42\u5728\u7ebf\u7b49<\/h3>\n<p>  \t\thtacces\u89c4\u5219\u5982\u4e0b\uff1a<br \/>  Options -Indexes +FollowSymLinks<br \/>  AddDefaultCharset UTF-8<br \/>  RewriteEngine On<br \/>  RewriteBase \/<\/p>\n<p>  #RewriteCond %{HTTPS} off<br \/>  #RewriteRule .* https:\/\/%{HTTP_HOST}%{REQUEST_URI} <br \/>  #RewriteCond %{HTTP_HOST} !^www.<br \/>  #RewriteRule .* https:\/\/www.%{HTTP_HOST}%{REQUEST_URI} <\/p>\n<p>  &lt;IfModule pagespeed_module&gt;<\/p>\n<p>  &nbsp; &nbsp; ModPagespeed off<\/p>\n<p>  &lt;\/IfModule&gt;<\/p>\n<p>  # exclude any paths that are not codeigniter-app related<br \/>  RewriteCond %{REQUEST_URI} !^\/server-status<br \/>  RewriteCond %{REQUEST_URI} !^\/server-info<br \/>  RewriteCond %{REQUEST_URI} !^\/docs<br \/>  RewriteCond %{REQUEST_FILENAME} !-f<br \/>  RewriteCond %{REQUEST_FILENAME} !-d<br \/>  &lt;IfModule mod_php5.c&gt;<br \/>  RewriteRule ^(.*)$ index.php\/$1 <br \/>  &lt;\/IfModule&gt;<br \/>  # the following is for rewritting under FastCGI<br \/>  &lt;IfModule !mod_php5.c&gt;<br \/>  RewriteRule ^(.*)$ index.php?\/$1 <br \/>  &lt;\/IfModule&gt;<br \/>  #PAGESPEED<br \/>  &lt;IfModule mod_expires.c&gt;<br \/>  ExpiresActive on<\/p>\n<p>  # Perhaps better to whitelist expires rules? Perhaps.<br \/>  ExpiresDefault&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;access plus 1 month&quot;<br \/>  # cache.appcache needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)<br \/>  ExpiresByType text\/cache-manifest&nbsp; &nbsp;&nbsp; &nbsp; &quot;access plus 0 seconds&quot;<\/p>\n<p>  # your document html <br \/>  ExpiresByType text\/html&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;access plus 0 seconds&quot;<\/p>\n<p>  # data<br \/>  ExpiresByType text\/xml&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;access plus 0 seconds&quot;<br \/>  ExpiresByType application\/xml&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;access plus 0 seconds&quot;<br \/>  ExpiresByType application\/json&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &quot;access plus 0 seconds&quot;<\/p>\n<p>  # rss feed<br \/>  ExpiresByType application\/rss+xml&nbsp; &nbsp;&nbsp; &nbsp; &quot;access plus 1 hour&quot;<\/p>\n<p>  # favicon (cannot be renamed)<br \/>  ExpiresByType image\/x-icon&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;access plus 1 month&quot;<\/p>\n<p>  # media: images, video, audio<br \/>  ExpiresByType image\/gif&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;access plus 3 months&quot;<br \/>  ExpiresByType image\/png&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;access plus 3 months&quot;<br \/>  ExpiresByType image\/jpg&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;access plus 3 months&quot;<br \/>  ExpiresByType image\/jpeg&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &quot;access plus 3 months&quot;<br \/>  ExpiresByType video\/ogg&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;access plus 3 months&quot;<br \/>  ExpiresByType audio\/ogg&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;access plus 3 months&quot;<br \/>  ExpiresByType video\/mp4&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;access plus 3 months&quot;<br \/>  ExpiresByType video\/webm&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &quot;access plus 3 months&quot;<\/p>\n<p>  # htc files(css3pie)<br \/>  ExpiresByType text\/x-component&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &quot;access plus 1 month&quot;<\/p>\n<p>  # webfonts<br \/>  ExpiresByType font\/truetype&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &quot;access plus 1 month&quot;<br \/>  ExpiresByType font\/opentype&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &quot;access plus 1 month&quot;<br \/>  ExpiresByType application\/x-font-woff&nbsp; &nbsp;&quot;access plus 1 month&quot;<br \/>  ExpiresByType image\/svg+xml&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &quot;access plus 1 month&quot;<br \/>  ExpiresByType application\/vnd.ms-fontobject &quot;access plus 1 month&quot;<\/p>\n<p>  # css and javascript<br \/>  ExpiresByType text\/css&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;access plus 2 months&quot;<br \/>  ExpiresByType application\/javascript&nbsp; &nbsp; &quot;access plus 2 months&quot;<br \/>  ExpiresByType text\/javascript&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;access plus 2 months&quot;<br \/>  &lt;IfModule mod_headers.c&gt;<br \/>  &nbsp; &nbsp; Header append Cache-Control &quot;public, no-transform&quot;<br \/>  &nbsp; &nbsp; Header set Connection keep-alive<br \/>  &lt;\/IfModule&gt;<\/p>\n<p>  &lt;\/IfModule&gt;<br \/>  #END PAGESPEED<\/p>\n<p>  \u8f6c\u4e3anginx\u89c4\u5219\u540e\uff1a<br \/>  # nginx configuration by winginx.com<\/p>\n<p>  autoindex off;<\/p>\n<p>  charset utf-8;<\/p>\n<p>  location ~ \/server-status {<br \/>  }<\/p>\n<p>  location ~ \/server-info {<br \/>  }<\/p>\n<p>  location ~ \/docs {<br \/>  }<\/p>\n<p>  autoindex off;<\/p>\n<p>  location \/ {<br \/>  if (!-e $request_filename){<br \/>  &nbsp; &nbsp; rewrite ^(.*)$ \/index.php\/$1 break;<br \/>  }<br \/>  rewrite ^(.*)$ \/index.php?\/$1 break;<br \/>  }<\/p>\n<p>  \u91cd\u542fnginx\u540e\u8fd0\u884c\u6b63\u5e38<\/p>\n<p>  \u4eca\u5929\u86cb\u75bc\u88c5\u4e86\u4e00\u4e0bbbr\uff0c\u91cd\u542f\u670d\u52a1\u5668\u4e4b\u540enginx\u5c31\u6302\u4e86\uff0c\u67e5\u770b\u65e5\u5fd7\u63d0\u793a\u7b2c\u5341\u516d\u884c\uff0c\u4e5f\u5c31\u662fautoindex off; \u91cd\u590d<br \/>  \u6dd8\u5b9d\u627e\u4e86\u4e24\u4e2a\u90fd\u6ca1\u641e\u5b9a\uff0c \u6709\u6ca1\u6709\u5927\u4f6c\u53ef\u4ee5\u6307\u70b9\u4e00\u4e8c\uff0c\u4ed8\u8d39\u662f\u80af\u5b9a\u7684\u3002  \t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>lowendtalk<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-3-19 16:31:48\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u53bbstackoverflow\u63d0\u95ee\u4e0d\u597d\u5417\uff1f\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>Mr.<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-3-19 16:32:15\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u592a\u957f\u4e86\u770b\u4e0d\u61c2\u3002\u3002\u3002\u8fd9\u4e48\u590d\u6742\u7684 rewrite \u4e3a\u4ec0\u4e48\u4e0d\u5728\u7a0b\u5e8f\u91cc\u505a\u3002\u3002\u3002\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>h20<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-3-19 16:33:05\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5206\u7c7blighttpd\u5374\u95ee\u7684\u662fapache\u8f6cnginx\u7684\u95ee\u9898:lol:lol\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>lanchenyuan<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-3-19 16:33:38\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u770b\u4e0d\u61c2\u2026\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u83dc\u82b1\u5927\u76d7 \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/61750"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=61750"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/61750\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=61750"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=61750"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=61750"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}