New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

绑定域名和80端口之后不能访问。 #811

Open
xiaoyaozz opened this Issue Aug 25, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@xiaoyaozz

xiaoyaozz commented Aug 25, 2018

域名解析到服务IP 139.199..
服务器全新安装的ubuntu16.04服务端,二进制安装leanote
在app.conf当中设置
http.port=80
site.url=http://a.com
但访问http://a.com的时候是没有反应的,请大神赐教,哪里出的问题?

@banfg56

This comment has been minimized.

Show comment
Hide comment
@banfg56

banfg56 Aug 31, 2018

这里面的域名 a.com 是你从浏览器地址访问域名,要把这个域名解析到你的服务器。
还有如果你服务80端口被占用,你要用在server 里根据域名配置一个网站重用80端口,在server里 proxy 到 leanote。

banfg56 commented Aug 31, 2018

这里面的域名 a.com 是你从浏览器地址访问域名,要把这个域名解析到你的服务器。
还有如果你服务80端口被占用,你要用在server 里根据域名配置一个网站重用80端口,在server里 proxy 到 leanote。

@liangyuanpeng

This comment has been minimized.

Show comment
Hide comment
@liangyuanpeng

liangyuanpeng Sep 2, 2018

域名是你服务器IP绑定的对应域名

也许a.com这个域名不是你的?

liangyuanpeng commented Sep 2, 2018

域名是你服务器IP绑定的对应域名

也许a.com这个域名不是你的?

@banfg56

This comment has been minimized.

Show comment
Hide comment
@banfg56

banfg56 Sep 3, 2018

你可能理解错误了。我说的意思这里面 a.com只是一个示范域名。比如我的域名j叫 xxa.com,然后我配置自己leanote在nginx中访问应该是这样的:

在nginx里面配置这个是为了你用80端口访问leanote服务,让leanote的服务是监听本地端口,避免风险

nginx的配置

# 假设leanote 在本地兼容的端口是 9001
upstream local9001 {
    server 127.0.0.1:9001;
}

server
{
   listen 80;
   server_name xxa.com;

   #rewrite ^/(.*) https://$server_name/$1 permanent;

   location / {
            proxy_pass         http://local9001;
            proxy_set_header   Host             $host;
            proxy_set_header   X-Real-IP        $remote_addr;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        }
}

leanote里的关键配置

http.addr=127.0.0.1 # listen on all ip addresses
http.port=9001

site.url=http://xxa.com

banfg56 commented Sep 3, 2018

你可能理解错误了。我说的意思这里面 a.com只是一个示范域名。比如我的域名j叫 xxa.com,然后我配置自己leanote在nginx中访问应该是这样的:

在nginx里面配置这个是为了你用80端口访问leanote服务,让leanote的服务是监听本地端口,避免风险

nginx的配置

# 假设leanote 在本地兼容的端口是 9001
upstream local9001 {
    server 127.0.0.1:9001;
}

server
{
   listen 80;
   server_name xxa.com;

   #rewrite ^/(.*) https://$server_name/$1 permanent;

   location / {
            proxy_pass         http://local9001;
            proxy_set_header   Host             $host;
            proxy_set_header   X-Real-IP        $remote_addr;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        }
}

leanote里的关键配置

http.addr=127.0.0.1 # listen on all ip addresses
http.port=9001

site.url=http://xxa.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment