国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Ist das ?ndern der Nginx-Konfigurationsdatei zum ?ndern des Website-Stammverzeichnisses ungültig?
高洛峰
高洛峰 2017-05-16 17:16:14
0
2
1061

CentOS6.4 64-Bit, Nginx ist 1.10.1, es müssen nur statische HTML-Seiten angezeigt werden
Das ursprüngliche Stammverzeichnis der Website ist /usr/local/nginx/html
Ich muss es in /srv/www/ ?ndern Im Folgenden finden Sie den Inhalt der Datei 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;


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;
    root /srv/www/;
        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   /srv/www/;
            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           /srv/www/;
        #    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;
    #    }
    #}

}

Es wird nach dem Speichern und Neustarten des Nginx-Dienstes nicht wirksam. Das Stammverzeichnis der Website ist immer noch die Willkommensseite von Nginx (/usr/local/nginx/html).
Warum? was zu tun?
Danke!

高洛峰
高洛峰

擁有18年軟件開發(fā)和IT教學(xué)經(jīng)驗(yàn)。曾任多家上市公司技術(shù)總監(jiān)、架構(gòu)師、項(xiàng)目經(jīng)理、高級(jí)軟件工程師等職務(wù)。 網(wǎng)絡(luò)人氣名人講師,...

Antworte allen(2)
為情所困

試試其他配置選項(xiàng)能否生效,比如訪問(wèn)或錯(cuò)誤日志。

世界只因有你

別在ngxin.conf 里配置,單獨(dú)放到外面,修改ngxin.conf

    省略......
    proxy_headers_hash_max_size 51200;
    proxy_headers_hash_bucket_size 6400;

    keepalive_timeout  65;

    #gzip  on;
    server {
        listen 80 default;
        return 204;
    }

    log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
        '$status $body_bytes_sent "$http_referer" '
        '"$http_user_agent" $http_x_forwarded_for '
        '"$upstream_addr" "$upstream_status" "$upstream_response_time" "$request_time"';
    include /etc/nginx/conf.d/*.conf;# 在這個(gè)目錄下面配置

在conf.d 目錄下面配置

server {
    listen       80;
    server_name  duweixin.net  www.duweixin.net;
    if ($host != 'www.duweixin.net' ) {
            rewrite ^/(.*)$ http://www.duweiwen.com/$1 permanent;
    }

    location ~ \.(js)$ {
            add_header Content-Type application/javascript;
            root /data/www/web/ROOT/;
    }

    location ~ \.css {
            add_header Content-Type text/css;
            root /data/www/web/ROOT/;
    }

    location ~ \.(gif|jpg|png|ico|ttf) {
            root /data/www/web/ROOT/;
    }
    
    location / {
            index index.html;
            access_log  /data/www/web/ng_access.log main;
            root /data/www/web/ROOT/;
    }

    location ~ \.(htm|html) {
            proxy_pass http://127.0.0.1:8186;
            expires off;
            index  index.htm;
    }
}

最后重啟ngxin

Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage