"nginx에 오신 것을 환영합니다" 및 "Apache2 Ubuntu 기본 페이지" 기본 페이지

"nginx에 오신 것을 환영합니다" 및 "Apache2 Ubuntu 기본 페이지" 기본 페이지

그래서 저는 Proxmox VE 5.3을 기본 OS로 사용하여 집에 물리적 서버를 설정했습니다. Proxmox에는 4개의 VM이 설치되어 있습니다.

  • 엔진엑스(Ubuntu 18.04 LTS VM에 설치됨)
  • 담화(Ubuntu 18.04 LTS VM에 설치됨), HTTP용으로 설정, HTTPS 설정 계획 있음
  • GitLab(Ubuntu 18.04 LTS VM에 설치됨), HTTP용으로 설정, HTTPS 설정 계획 있음
  • ownCloud(Ubuntu 18.04 LTS VM에 설치됨), HTTPS용으로 설정됨

이 설정의 아이디어는 Nginx가 다른 3개의 VM을 역방향 프록시하는 것입니다. 불행히도 나는 이것 때문에 많은 어려움을 겪고 있는 것 같습니다. 아래 표에서 브라우저에 표시되는 내용을 보여드리겠습니다.

----------------------------------------------------------------------------------------------------------------------------------------------------------
|    VM     |                URL                                    |                         What I get back in the Browser                             |
----------------------------------------------------------------------------------------------------------------------------------------------------------
| Discourse | http://discourse.myreserveddns.com                    | "Welcome to nginx!" default page                                                   |
| GitLab    | http://git.myreserveddns.com                          | Redirects to http://git.myreserveddns.com/users/sign_in, the page I expect to see. |
| ownCloud  | http://oc.myreserveddns.com                           | Redirects to https://oc.myreserveddns.com                                          |
| ownCloud  | https://oc.myreserveddns.com                          | "Apache2 Ubuntu Default Page"                                                      |
| ownCloud  | https://oc.myreserveddns.com/owncloud/index.php/login | I get the ownCloud login page, as I expect to see.                                 |
----------------------------------------------------------------------------------------------------------------------------------------------------------

따라서 기본적으로 GitLab은 예상대로 리디렉션됩니다. ownCloud 전체 URL이 포함된 로그인 페이지로 이동할 수 있지만 다음과 같은 간단한 URL이 필요합니다.http://oc.myreserveddns.com그리고https://oc.myreserveddns.com로그인 URL과 Discourse로 라우팅하려면 "Welcome to nginx!"라는 메시지만 받을 수 있습니다. 기본 페이지. 담론의 경우, 적절한 담론 페이지를 찾았다는 점을 언급해야 합니다.http://discourse.myreserveddns.com, 그러나 브라우저에서 개인 IP를 테스트한 후에는 Nginx 기본 페이지만 표시됩니다.

어쨌든 여기 /etc/nginx/sites-available에 있는 내 Nginx conf 파일이 있습니다(예, 모두 /etc/nginx/sites-enabled에 대한 심볼릭 링크를 포함합니다):

담론.conf

server {
# The IP that you forwarded in your router (nginx proxy)
  listen 192.168.1.101:80; listen [::]:80;

# Make site accessible from http://localhost/
 server_name discourse.myreserveddns.com;

# The internal IP of the VM that hosts your Apache config
 set $upstream 192.168.1.104;

 location / {

 proxy_pass_header Authorization;
 proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;
 proxy_set_header Host $http_host;
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_set_header X-Forwarded-Proto $scheme;
 proxy_http_version 1.1;
 proxy_set_header Connection "";
 proxy_buffering off;
 client_max_body_size 0;
 proxy_read_timeout 36000s;
 proxy_redirect off;

 }
}

gitlab.conf (코드를 포함해야 하지만 게시물이 스팸처럼 보이고 표시할 다른 CONF 파일보다 덜 중요하다는 말을 들었습니다.)

owncloud.conf

server {
# The IP that you forwarded in your router (nginx proxy)
  listen 192.168.0.101:443 ssl;

# SSL config
 ssl on;
 ssl_certificate /etc/nginx/ssl/owncloud.crt;
 ssl_certificate_key /etc/nginx/ssl/owncloud.key;

# Make site accessible from http://localhost/
 server_name oc;

# The internal IP of the VM that hosts your Apache config
 set $upstream 192.168.0.102;

 location / {

 proxy_pass_header Authorization;
 proxy_pass https://$upstream;
 proxy_set_header Host $host;
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_http_version 1.1;
 proxy_set_header Connection "";
 proxy_buffering off;
 client_max_body_size 0;
 proxy_read_timeout 36000s;
 proxy_redirect off;

 }
}

그래서 두 가지 주요 질문이 있다고 생각합니다.

  1. 왜 "nginx에 오신 것을 환영합니다!"라는 메시지가 표시됩니다. 및 "Apache2 Ubuntu 기본 페이지" 기본 페이지? Nginx에서 이러한 "기본" 페이지를 어디서 찾을 수 있나요?
    • ownCloud의 기본 Apache 페이지는 매우 이상합니다. SSL을 위해 Apache를 실행하므로 기본 페이지는 ownCloud VM에 있을 수 있습니다. 한편 Discourse에는 Nginx가 전혀 설치되어 있지 않습니다!
  2. Nginx를 사용하여 한 링크에서 다른 링크로 리디렉션할 수 있나요? 예를 들어 다음에서 리디렉션할 수 있나요?https://oc.myreserveddns.com에게https://oc.myreserveddns.com/owncloud/index.php/login?

관련 정보