我不仅要通过IP_OF_SYNOLOGY:PORT从LAN访问Jira(Synology DS716 + II上的Docker),还需要通过jira.synology.local例如 [英] I want to access Jira (Docker on Synology DS716+II) from LAN not only via IP_OF_SYNOLOGY:PORT but for example jira.synology.local

查看:209
本文介绍了我不仅要通过IP_OF_SYNOLOGY:PORT从LAN访问Jira(Synology DS716 + II上的Docker),还需要通过jira.synology.local例如的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Synology NAS类型aDS716 + II,DSM 6.1.4-15217 Update 2在使用Jira容器的Docker上运行.

I am working with a Synology NAS type aDS716+II, DSM 6.1.4-15217 Update 2 on wich runs Docker with a Jira container.

所以现在我要去上班的 我要访问的是Jira的Web界面,比如说jira.synology.local,其中synology是服务器名.

So now what I want to do I'm assinged to get to work is to access Jira's webinterface with let's say jira.synology.local with synology being the servername.

我从DSM 6.X以来读了很多有关nginx以及它是如何构建的,但是我似乎根本无法正确地使用它.

I read a lot about nginx and how it's built in since DSM 6.X but I don't seem to get it to work properly at all.

我可以通过IP_OF_SYNOLGY:PORT从LAN内的另一台计算机访问Jira的Web界面,因此在服务器上设置反向代理时,它应该指向LOCALHOST:PORT,对吗?我还尝试使用实际IP代替LOCALHOST,但是没有成功.

I can access Jira's webinterface from another machine within the LAN via IP_OF_SYNOLGY:PORT so when setting up a reverse proxy on the server it should be pointing to LOCALHOST:PORT right? I have also tried using the actual IP instead of LOCALHOST but without success.

设置域名后,不仅可以通过IP_OF_SYNOLGY:PORT访问Synology本身的界面,还可以通过DOMAINNAME.LOCAL访问.

I can access the interface of Synology itself not only via IP_OF_SYNOLGY:PORT but also via DOMAINNAME.LOCAL if I set the domain name.

我真的不知道自己缺少什么,我尝试了所有我能想到的.有人对此有经验吗?

I really don't know what I'm missing and I tried everything I could think of. Does someone has experience with this?

如果缺少某些信息,我会很乐意提供.我必须承认Synology是新手.预先感谢!

If some information is missing, I'll gladly provide it. I'm fairly new to synology I have to admit. Thanks in advance!

推荐答案

因此该响应为零,但我认为将来有人可能会遇到类似的问题",所以我还是会回答.

So this has gotten zero response but I figured probably someone will have a similar "problem" in the future, so I will answer anyway.

设置Active Directory时,我解决了所有问题.安装AD时,DNS服务器也将自动安装.

I solved everything, when I setup Active Directory. When installing AD, the DNS-Server will automatically be installed too.

因此,我们有一个运行在Docker容器中的JIRA(在端口上,例如 12345 ),我想通过LAN上的 jira.domainname 来访问它.

So we have JIRA running in a Docker container (on port, let's say, 12345) and I want to access it via the LAN on jira.domainname.

要这样做,我们需要安装DSM6.X或更高版本(对于 nginx )和DNS服务器.就是这样.

To do so we need to have installed DSM6.X or higher (for nginx) and the DNS-Server. That's it.

在DNS服务器中,您将必须创建一个新的主区域

In the DNS-Server you will have to create a new master zone

并应用以下设置,而您可以自由选择域名,并且主DNS服务器必须是您的Synology Station的IP,因为它可以充当DNS

and apply the following settings, whereas you can freely choose the domain name and Master DNS server must be the IP of your synology station, since it functions as a DNS

然后您要编辑资源记录

您要在其中添加A记录资源

There you want to add an A Record Resource

和CNAME记录资源

因此您的资源记录将如下所示

So your Resource Records will look like this

现在,设置DNS服务器的最后一步是告诉它,如果没有用于查询的特定记录,该怎么办.因此,例如,如果您想在浏览器中打开 jira.domainname ,则有一个特定的记录,DNS服务器知道如何对其进行定向.但是,例如,如果您要打开 google.com ,则DNS服务器将没有任何信息,并且现在知道该怎么做.因此,如果没有请求记录,我们现在要告诉DNS服务器转发该请求.为此,请启用转发器,并将网关/管理型交换机的IP设置为主服务器,并将某些公共DNS服务器(对于Google的DNS服务器之一为 8.8.8.8 )作为辅助服务器.

Now the last step for setting up the DNS server is to tell it what to do if there is no specific record for a query. So for example if you want to open jira.domainname in your browser, there is a specific record for that and the DNS server knows how to direct it. But if you want to open up for example google.com the DNS server has no information on that and does now know what to do. So what we do now is to to tell the DNS server to forward the request, if it has no records for a request. To do so, enable the forwarders and put in the IP of your gateway/ managed switch as primary and some public DNS server (8.8.8.8 for one of google's DNS server) as secondary.

请记住, jira.domainname 始终是您选择的域名,而 192.168.0.200 始终是您的synology station的IP.

Please remember that jira.domainname shall always be the domainname you choose and 192.168.0.200 shall always be the IP of your synology station.

因此,现在DNS服务器已完全设置.现在,我们要利用内置的反向代理(在后台在nginx上运行).为此,我们按此处所示进行导航

So now the DNS server is completely setup. Now we want to take advantage of the built-in reverse proxy (which runs on nginx in the background). To do so we navigate as seen here

并创建新的反向代理规则

and create a new reverse proxy rule

因此,现在URL可以指向相同的目的地(您的语法为192.168.0.200),但指向不同的端口.对于在docker中运行的某些应用程序来说,这非常方便.

So now that the URL's can point to the same destination (your synology, 192.168.0.200) but on different Port. That comes in very handy for some applications running in docker.

因此,现在如果您是在家庭设置或小型办公室中运行它,则可能正在使用标准问题商用路由器,例如AVM的FritzBox.这些非常好,但是请注意,有些禁止所谓的 DNS Rebinding ,这意味着将不允许指向本地IP的DNS请求.由于在此设置中,DNS服务器(您的synology)和目标JIRA(也是您的synology)位于同一LAN中,因此我们必须创建一个例外.可能其他路由器不会抑制这些请求,但是如果是这样,则必须有例外.

So now if you are running this in an home setup or small office, you probably are working with standard issue commercial router such as for example a FritzBox by AVM. Those are pretty good but beware that some prohibit the so called DNS Rebinding which means that DNS requests pointing to a local IP will be not allowed. Since in this setup the DNS server (your synology) and the destination JIRA (also your synology) are in the same LAN, we have to create an exception. Probably other routers don't suppress those requests, but if so exceptions are necessary.

因此,下一步,它告诉网关或受管交换机,它必须使用新设置的DNS服务器作为主DNS服务器.对于FritzBox,您可以在这里

So the next step, it to tell your Gateway or managed switch that it has to use the newly setup DNS server as the primary DNS server. For FritzBox' you can do so here

输入您的DNS服务器和辅助DNS服务器的IP.如果您的DNS服务器可能在某个时候停止工作,那么这对于作为后备解决方案非常重要.

put in the IP of your DNS server and an secondary DNS server. This is important as a fallback solution if your DNS server probably stops working at some point.

现在一切都已设置好,我建议重新启动路由器/管理型交换机,Synology和您正在使用的工作站,以刷新所有缓存.之后,您只需打开浏览器并输入 jira.domainname 即可打开JIRA.您也可以打开终端/cmd并键入nslookup jira.domainname以查看其是否被正确解析.

Now that everything is setup I would recommend to restart the router/ managed switch, synology and the workstation you are working on, to flush all caches. After that you can simply open your browser and type in jira.domainname and JIRA should open up. You can also open a terminal/ cmd and type in nslookup jira.domainname to see if it is being resolved correctly.

我真的希望这会在某个时候对某人有所帮助,如果还有其他问题,请随时发表评论或直接写信给我!

I really hope this will help someone at some point and if there are any additional questions, please feel free to comment this or write me directly!

这篇关于我不仅要通过IP_OF_SYNOLOGY:PORT从LAN访问Jira(Synology DS716 + II上的Docker),还需要通过jira.synology.local例如的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆