ini example_nginx_config_wpmulsite.conf

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ini example_nginx_config_wpmulsite.conf相关的知识,希望对你有一定的参考价值。

map $uri $blogname{
    ~^(?P<blogpath>/[^/]+/)files/(.*)   $blogpath ;
}

map $blogname $blogid{
    default -999;

    #Ref: http://wordpress.org/extend/plugins/nginx-helper/
    #include /var/www/wordpress/wp-content/plugins/nginx-helper/map.conf ;
}

server {
    listen 80;
    server_name example.com ;

    root /var/www/vhosts/example.com/html;
    index index.php;

    location ~ ^(/[^/]+/)?files/(.+) {
        try_files /wp-content/blogs.dir/$blogid/files/$2 /wp-includes/ms-files.php?file=$2 ;
        access_log off; log_not_found off; expires max;
    }

    #avoid php readfile()
    location ^~ /blogs.dir {
        internal;
        alias /var/www/vhosts/example.com/html/content/uploads ;
        access_log off; log_not_found off; expires max;
    }

    if (!-e $request_filename) {
        rewrite /wp-admin$ $scheme://$host$uri/ permanent;
        rewrite ^(/[^/]+)?(/wp-.*) $2 last;
        rewrite ^(/[^/]+)?(/.*\.php) $2 last;
    }

    location / {
        try_files $uri $uri/ /index.php?$args ;
        index index.php;
    }

    location ~ \.php$ {
            try_files $uri =404;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/tmp/php5-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
    }


    #add some rules for static content expiry-headers here
}

ini

配置文件读取ini

config_handler.py
from configparser import ConfigParser


class configHandler(ConfigParser):

    def __init__(self,file,encoding=utf-8):
        """
        :file:配置文件路径
        """
        super().__init__()#初始化ConfigParser,config = ConfigParser()
        self.read(file,encoding=encoding)

if __name__ == __main__:
    #读取
    config = configHandler(py.ini)
    a = config.get(teachers,name)
    print(a)

py.ini

[teachers]
name = [zc,zc1]

 

以上是关于ini example_nginx_config_wpmulsite.conf的主要内容,如果未能解决你的问题,请参考以下文章

ini

PHP_php.ini_说明详解

8_Php.ini 配置文件详解

pytest-18-配置文件pytest.ini

Python读取ini配置文件

ini _etc_httpd_conf_httpd.conf