现在配置的完成后,访问地址是 bbs.163.com/sym,如何去掉 sym 目录,直接输入 bbs.163.com 就可以访问呢?
ngxin 代理
upstream sym {
server 192.168.1.2:8082;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name bbs.163.com;
location / {
proxy_pass http://sym$request_uri;
proxy_http_version 1.1;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
jetty 配置
start.ini
## Connector host/address to bind to
jetty.http.host=192.168.1.2
## Connector port to listen on
jetty.http.port=8082
# Monitored directory name (relative to $jetty.base)
# jetty.deploy.monitoredDir=webapps
# - OR -
# Monitored directory path (fully qualified)
jetty.deploy.monitoredPath=/www/domain/163.com/webapps
latke.properties 配置
#### Server ####
# Browser visit protocol
serverScheme=http
# Browser visit domain name
serverHost=bbs.163.com
# Browser visit port, 80 as usual, THIS IS NOT SERVER LISTEN PORT!
serverPort=80
#### Runtime Mode ####
#runtimeMode=DEVELOPMENT
runtimeMode=PRODUCTION
解决该问题
在 war 包目录下面新建一个 xml 文件,配置下面内容
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/</Set>
<Set name="war">/www/domain/163.com/webapps/sym.war</Set>
</Configure>
参考如下:
http://www.eclipse.org/jetty/documentation/current/configuring-specific-webapp-deployment.html
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于