[图片] lake.properties 配置如下 [图片] local.properties 配置如下 按道理应该是 80 端口访问呀不知道为啥访问不了 [图片] 将 war 包放到了 webapps 下 [图片] nginx.conf 配置如下 #user nobody; worker_processes 1; # ..

心塞,关于博客部署,都是按照步骤配的

本贴最后更新于 476 天前,其中的信息可能已经东海扬尘

imagepng
lake.properties 配置如下

imagepng
local.properties 配置如下
按道理应该是 80 端口访问呀不知道为啥访问不了
imagepng

将 war 包放到了 webapps 下

imagepng
nginx.conf 配置如下

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;
upstream backend {
    server localhost:8080; # Tomcat/Jetty 监听端口
}

server {
    listen       80;
    server_name  www.icodeboy.top # 博客域名

    access_log off;

    location / {
        proxy_pass http://backend$request_uri;
        proxy_set_header  Host $host:$server_port;
        proxy_set_header  X-Real-IP  $remote_addr;
        client_max_body_size  10m;
    }
}

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }

求大佬指路

  • Solo

    Solo 是一款小而美的开源博客系统,专为程序员设计。

    Solo 有着非常活跃的社区,可将文章作为帖子推送到社区,来自社区的回帖将作为博客评论进行联动。

    这是一种全新的网络社区体验,让热爱记录和分享的你不再感到孤单!
    具体细节请浏览 B3log 构思

    877 引用 • 6709 回帖 • 669 关注
  • 部署
    18 引用 • 268 回帖
6 回帖
请输入回帖内容...
  • 88250

    F12 看一下请求你就懂了。

  • mufengcoding

    server 为啥要放到 http 外层,还有就是那个 url 是自己跳到www.icodeboy.top:8080的吗

  • d249304032

    同样问题求指点,F12 打开之后 4 个请求全部 200,响应无样式的登陆页面,浏览器显示同楼主

  • vinasis

    楼主恁的 nginx 如果代理了 80 端口并且反向代理了汤姆🐱8080,你怎么会用浏览器 8080 端口直接访问呢。

  • vinasis 1

    楼主窝给你看下窝的配置

    首先是 Nginx

    imagepng

    
    user  nginx;
    worker_processes  1;
    
    error_log  /var/log/nginx/error.log warn;
    pid        /var/run/nginx.pid;
    
    
    events {
        worker_connections  1024;
    }
    
    
    http {
        include       /etc/nginx/mime.types;
        default_type  application/octet-stream;
    
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for"';
    
        access_log  /var/log/nginx/access.log  main;
    
        sendfile        on;
        #tcp_nopush     on;
    
        keepalive_timeout  65;
    
        #gzip  on;
    	
    upstream backend {
        server localhost:8080;
    }
    
     server {
    
    	listen       80;
           	server_name  vinasis.com www.vinasis.com;
           	rewrite ^ https://$http_host$request_uri? permanent;    # force redirect http to https
    	return 301 https://$http_host$request_uri;
    }
    
     server {
    	listen       443 ssl;
    	server_name  www.vinasis.net;
         	#证书配置
        	ssl_certificate "/etc/nginx/www.vinasis.net_ca.crt";
        	ssl_certificate_key "/etc/nginx/www.vinasis.net.key";
    	ssl_session_cache    shared:SSL:1m;
    	ssl_session_timeout  5m;
    	ssl_ciphers  HIGH:!aNULL:!MD5;
    	ssl_prefer_server_ciphers  on;
    
    location ^~ / {
         proxy_pass http://backend$request_uri;
         proxy_set_header  Host $host:$server_port;
         proxy_set_header  X-Real-IP  $remote_addr;
    	proxy_set_header X-Forwarded-Proto https;
         client_max_body_size  10m;
         }     
    
    
         error_page 404 /404.html;
             location = /40x.html {
         }
    
         error_page 500 502 503 504 /50x.html;
             location = /50x.html {
         }
     }
    
    }
    
    
    

    **** 汤姆猫配置 ****

    默认 8080 不变
    imagepng

    默认 Host 设置成 域名
    imagepng

    然后修改对应的 HOST 指向 solo 路径

  • vinasis

    窝 solo 是放在 webapps\ROOT 目录下

    imagepng

请输入回帖内容 ...