访问tomcat 服务器出现,Welcome to nginx!

      如果我的博客能够帮到大家能够点个赞,关注一下,以后还会更新更过JavaWeb的高级技术,大家的支持就是我继续更新的动力。谢谢。

  今天在使用服务器部署项目访问的时候,遇到了如下问题  

   问题:通过外网访问部署在服务器上的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 访问:

 

成功!!! 

  • 4
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值