在OpenSuse VM上设置Nginx和Lucee的新安装之后,我现在可以通过内部IP和Tomcat端口访问Lucee admin,但是如果我尝试访问设置的小测试页,最后,我最终进入了“包罗万象”的页面,这意味着Lucee的欢迎页面。
这可能非常简单,但是我一直在忽略可能造成这种情况的细节,因此我希望你们中的一个能为我指明正确的方向。
这是删除我已经推荐的所有内容之后看到的所有内容之后的server.xml和nginx.conf文件的压缩版本。
基于域的主机块和已定义的上游存储区可以使以后添加更多站点变得更加容易。
user web-user;
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}
http {
include mime.types;
default_type application/octet-stream;
server_tokens off;
server_names_hash_bucket_size 64;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_http_version 1.1;
gzip_comp_level 4;
gzip_types text/plain text/javascript application/javascript text/css application/x-javascript application/xml application/xml+rss application/json application/font-woff;
gzip_vary on;
upstream lucee_servers {
ip_hash;
server localhost:8888;
keepalive 32;
}
#############
# sites
#############
server {
server_name .exampleurl.de;
listen 80;
root /opt/wwwRailo/exampleurl;
index index.cfm;
expires 1h;
add_header Pragma public;
add_header Cacle-Control "public";
# include vw/lucee-base-include.conf;
location ~ \.(cfm|cfml)(.*)$ {
proxy_pass http://lucee_servers;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; ## CGI.REMOTE_ADDR
proxy_set_header X-Forwarded-Proto $scheme; ## CGI.SERVER_PORT_SECURE
proxy_set_header X-Real-IP $remote_addr;
}
break;
}
}
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<Service name="Catalina">
<Connector port="8888" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
useHttpOnly="true"/>
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="myDefaultHost">
<Host name="myDefaultHost" appBase="webapps"
unpackWARs="false" autoDeploy="false">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" resolveHosts="false"/>
<Valve className="mod_cfml.core"
loggingEnabled="false"
waitForContext="3"
maxContexts="200"
timeBetweenContexts="30000"
/>
</Host>
<Host name="exampleurl.de" appBase="webapps">
<Alias>www.exampleurl.de</Alias>
<Context path="" docBase="/opt/wwwRailo/priceBoard" useHttpOnly="true" />
</Host>
</Engine>
</Service>
</Server>
在此先感谢您的浏览!
最佳答案
事实证明,该配置可以按预期工作,但是管理员通过转发服务注册了该域,却忘记了设置第二项设置。因此,某种程度上,只有nginx能够检测到请求所针对的域,而Tomcat却没有,因此触发了默认行为,即“欢迎页面”。