>  기사  >  백엔드 개발  >  Alibaba Cloud에서 클라우드 서비스를 구입했는데 HTML을 어디에서 액세스할 수 있나요?

Alibaba Cloud에서 클라우드 서비스를 구입했는데 HTML을 어디에서 액세스할 수 있나요?

WBOY
WBOY원래의
2016-12-05 13:44:291842검색

다음은 내 서버 디렉토리입니다. test.html 파일을 작성했다면 어느 디렉토리에 업로드해야 하나요? 그렇다면 다른 사람들이 이 페이지에 접근하기 위해 어떤 경로를 사용할 수 있나요?
Alibaba Cloud에서 클라우드 서비스를 구입했는데 HTML을 어디에서 액세스할 수 있나요?

안 되는 것 같나요?
Alibaba Cloud에서 클라우드 서비스를 구입했는데 HTML을 어디에서 액세스할 수 있나요?

다음은 내 nginx 구성입니다

<code># For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    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;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location ~ ^/wechat/.+ {
          proxy_pass http://127.0.0.1:3000;
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

# Settings for a TLS enabled server.
#
#    server {
#        listen       443 ssl http2 default_server;
#        listen       [::]:443 ssl http2 default_server;
#        server_name  _;
#        root         /usr/share/nginx/html;
#
#        ssl_certificate "/etc/pki/nginx/server.crt";
#        ssl_certificate_key "/etc/pki/nginx/private/server.key";
#        ssl_session_cache shared:SSL:1m;
#        ssl_session_timeout  10m;
#        ssl_ciphers HIGH:!aNULL:!MD5;
#        ssl_prefer_server_ciphers on;
#
#        # Load configuration files for the default server block.
#        include /etc/nginx/default.d/*.conf;
#
#        location / {
#        }
#
#        error_page 404 /404.html;
#            location = /40x.html {
#        }
#
#        error_page 500 502 503 504 /50x.html;
#            location = /50x.html {
#        }
#    }

}

</code>

답글 내용:

다음은 내 서버 디렉토리입니다. test.html 파일을 작성했다면 어느 디렉토리에 업로드해야 하나요? 그렇다면 다른 사람들이 이 페이지에 접근하기 위해 어떤 경로를 사용할 수 있나요?
Alibaba Cloud에서 클라우드 서비스를 구입했는데 HTML을 어디에서 액세스할 수 있나요?

안 되는 것 같나요?
Alibaba Cloud에서 클라우드 서비스를 구입했는데 HTML을 어디에서 액세스할 수 있나요?

다음은 내 nginx 구성입니다

<code># For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    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;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location ~ ^/wechat/.+ {
          proxy_pass http://127.0.0.1:3000;
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

# Settings for a TLS enabled server.
#
#    server {
#        listen       443 ssl http2 default_server;
#        listen       [::]:443 ssl http2 default_server;
#        server_name  _;
#        root         /usr/share/nginx/html;
#
#        ssl_certificate "/etc/pki/nginx/server.crt";
#        ssl_certificate_key "/etc/pki/nginx/private/server.key";
#        ssl_session_cache shared:SSL:1m;
#        ssl_session_timeout  10m;
#        ssl_ciphers HIGH:!aNULL:!MD5;
#        ssl_prefer_server_ciphers on;
#
#        # Load configuration files for the default server block.
#        include /etc/nginx/default.d/*.conf;
#
#        location / {
#        }
#
#        error_page 404 /404.html;
#            location = /40x.html {
#        }
#
#        error_page 500 502 503 504 /50x.html;
#            location = /50x.html {
#        }
#    }

}

</code>

먼저 nginx나 apache 중 하나의 서버 환경을 설치
그런 다음 파일을 웹 디렉토리의 루트 디렉토리
마지막으로 브라우저에 서버 IP를 입력하세요

로컬 Unix 환경과 동일

저는 nodejs+nginx를 사용합니다

root /usr/share/nginx/html;
이 줄은 nginx 구성의 웹 루트 디렉터리를 설명합니다

/은 서버 시스템의 루트 디렉터리를 나타냅니다. 혼동하지 마세요.

먼저 질문에 대답하세요. 웹 서버가 필요합니다(nginx/apache도 허용됨)

해야 할 일: 먼저 nginx/apache를 로컬에 설치하고 실행한 다음 10분 동안 각 디렉터리의 역할을 이해합니다.

Nginx나 Apache 환경 중 익숙한 환경을 사용하세요. Nginx를 사용한다면 Nginx의 구성을 이해해야 합니다. 일반적으로 Nginx 환경에서 표시하려는 IP 주소, 포트, 파일 경로(즉, Nginx.conf 파일)를 구성해야 합니다. 그런 다음 Nginx를 다시 시작하십시오. 이것이 가장 간단한 구성 프로세스입니다

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.