Maison > développement back-end > tutoriel php > nginx配置vhost例子

nginx配置vhost例子

WBOY
Libérer: 2016-07-29 08:58:52
original
977 Les gens l'ont consulté

nginx下面几个配置vhost的例子
php

<code>server {
server_name stage.localhost;
<span>listen</span><span>80</span> ;
        root /data;
        <span>index</span><span>index</span>.html <span>index</span>.htm <span>index</span>.php;
location ~ .php$ {
        fastcgi_pass <span>127.0</span>.<span>0</span>.<span>1</span>:<span>9000</span>;
        fastcgi_index <span>index</span>.php;
        fastcgi_param SCRIPT_FILENAME  /data<span>$fastcgi_script_name</span>;
        include fastcgi_params;
    }
}</code>
Copier après la connexion

静态文件

<code>server {
server_name sms<span>.fake</span><span>;</span>
listen <span>80</span><span>;</span>
        root /data/fakesms<span>;</span>
        index mobile1<span>.html</span> mobile1b<span>.html</span><span>;</span>
}</code>
Copier après la connexion

其他语言开发的server服务

<code>server {
    listen   <span>80</span>;
    server_name localhost<span>.</span>pythonserver;

    access_log /<span>var</span>/<span>log</span>/nginx/pythonserver<span>-access</span><span>.</span><span>log</span> ;
    error_log /<span>var</span>/<span>log</span>/nginx/pythonserver<span>-error</span><span>.</span><span>log</span> ;
    charset utf<span>-</span><span>8</span>;
    client_max_body_size    <span>100</span>m;
    client_body_timeout     <span>60</span>;      
    location /exam0<span>/</span> {
        proxy_pass http:<span>//127.0.0.1:8889;</span>
    }
    location /exam1<span>/</span> {
        proxy_pass http:<span>//127.0.0.1:8880;</span>
    }
    location /exam2<span>/</span> {
        proxy_pass http:<span>//127.0.0.1:8881;</span>
    }
}</code>
Copier après la connexion
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

以上就介绍了nginx配置vhost例子,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Étiquettes associées:
source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal