访问tomcat 服务器出现,Welcome to nginx!
今天在使用服务器部署项目访问的时候,遇到了如下问题
问题:通过外网访问部署在服务器上的tomcat ,出现
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
错误原因:
nginx 配置使用80端口,自动跳转到欢迎页面(welcome to nginx!),但是其他端口可以正常使用
解决办法:
找到defaule文件,一般在:cd /etc/nginx/sites-available 下 在这里你会看到有一个default文件,打开该文件,如下:
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
# Default server configuration
#
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
修改后:
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
# Default server configuration
#
server {
listen 12312 default_server;
listen [::]:12312 default_server;
# SSL configuration
查看 80 duan端口占用:ps -aux |grep 80
若有 80 端口进程 使用 kill -9 PID 杀死
reboot 重启Ubuntu 访问: