nginx apache html文件,apache – 如何将我的.htaccess文件转换为NGINX?

我如何转换我的下面的.htaccess(Apache)文件,以便NGINX可以使用它?

Options -Indexes

Options +FollowSymLinks

# Enable ETag

#FileETag MTime Size

FileETag none

# Set expiration header

ExpiresActive on

ExpiresDefault A2592000

Header append Cache-Control "public"

# Compress some text file types

AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml application/x-javascript text/javascript application/javascript application/json

# Deactivate compression for buggy browsers

BrowserMatch ^Mozilla/4 gzip-only-text/html

BrowserMatch ^Mozilla/4\.0[678] no-gzip

BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# Set header information for proxies

Header append Vary User-Agent

########################################################

# Rewrite Rules

########################################################

RewriteEngine on

# Require SSL (HTTPS) on the signup page

RewriteCond %{SERVER_PORT} 80

RewriteCond %{REQUEST_URI} ^/signup/?

RewriteRule ^(.*)$https://www.example.com/$1 [R,L]

# Redirect /signup/plan or /signup/plan/ -> /signup/index.php?account_type=plan

RewriteRule ^signup/([A-Za-z]+)/?$/signup/index.php?account_type=$1 [NC,L]

# Redirect /home/123 or /home/123/ -> home.php?home_id=123

RewriteRule ^home/([0-9]+)/?$home.php?home_id=$1 [NC,L]

# Redirect /homes/ in case someone made a typo when it should have been /home/

RewriteRule ^homes/([0-9]+)/?$home.php?home_id=$1 [NC,L]

#################################################

# Default Settings

#################################################

# hide apache server signaute on apache generated pages (e.g. 404)

ServerSignature Off

解决方法:

标签:htaccess,nginx,apache

来源: https://codeday.me/bug/20190730/1583567.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值