如何使Digital Access Pass子目录(... / dap)使用http on nginx Web服务器,操作系统:Ubuntu?

点头

我已经安装了Nginx Web服务器和https域。我想在根文件夹中创建一个子目录/ dap以使用http并从ssl中排除。请通过这个指导我。

我的/ etc / nginx / sites-可用的虚拟主机文件如下:

# WPSINGLE FAST CGI NGINX CONFIGURATION
server {
    listen 198.27.70.206:80;
    server_name howtofightnow.com;
        return 301 https://howtofightnow.com$request_uri;
}

server {
        listen   443 ssl;
        server_name howtofightnow.com;
        ssl    on;
        ssl_certificate    /etc/nginx/ssl/howtofightnow_com.pem;
        ssl_certificate_key    /etc/nginx/ssl/server.key;
    #listen 198.27.70.206:80;
    #server_name howtofightnow.com; 

    access_log   /var/log/nginx/howtofightnow.com.access.log rt_cache;
    error_log    /var/log/nginx/howtofightnow.com.error.log;

    root /var/www/howtofightnow.com/htdocs;
    index index.php index.htm index.html;

        location /zabbix {
            if ($scheme ~ ^http:){
                rewrite ^(.*)$  https://$host$1 permanent;
            }
        alias           /usr/share/zabbix;
        index           index.php;
        error_page      403 404 502 503 504  /zabbix/index.php;

        location ~ \.php$ {
            if (!-f $request_filename) { return 404; }
            expires     epoch;
            include     fastcgi_params;
            fastcgi_index   index.php;
            fastcgi_pass    php;
            }
        location ~ \.(jpg|jpeg|gif|png|ico)$ {
            access_log  off;
            expires     33d;
        }
    }

    # Use Cached Or Actual File If They Exists, Otherwise Pass Request To WordPress
    location / {
        try_files $uri $uri/ /index.php?$args;
    }


    location ~ .php$ {
        try_files $uri /index.php?args;
        include fastcgi_params;
        fastcgi_pass php;

    }

    location /vma {
          root /usr/local/vimbadmin/public ;
          try_files $uri $uri/ /index.php?$args;


                location ~ .php$ {
                try_files $uri =404;
                include fastcgi_params;
                fastcgi_pass php;

                }

    }
    rewrite ^/index.php/register/thanks(.*) /register/thanks$1  permanent;
    include /etc/nginx/common/locations.conf;
}
童话故事

只需将此位置(/ dap)添加到您的http服务器部分,再添加一个单独的根位置,如下所示:

server {
    listen 198.27.70.206:80;
    server_name howtofightnow.com;

    location / {
      return 301 https://howtofightnow.com$request_uri;
    }

    location /dap/ {
      # specific rules for this location go here
    }  

}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

使用PHP的Nginx子目录根

使用Nginx的子目录上的WordPress,使用没有密码的Proxy Pass错误

如何使资产与Nginx子目录中的Symfony3一起使用

如何使用 Nginx 在子目录中安装 Ghost?(获得 404)

nginx通过uWSGI在子目录中服务Django

使用NGINX将Gatsby托管在子目录上

子目录中的 Laravel 使用 NGINX 并保留路由

使用 nginx 在 rails 子目录上运行 Wordpress

同一服务器中Rails应用子目录中Wordpress的Nginx配置

如何仅使用子目录的名称查找特定深子目录的路径?

如何从子目录导入文件并使用子目录名称R命名它们

Nginx及其子目录

如何使用 AngularJS 在 ubuntu 16.4 的子目录中安装 WordPress

如何使用cmake为嵌套子目录设置Visual Studio筛选器

如何在CodeIgniter 4中使用子目录控制器?

如何使用wget下载整个目录和子目录?

如何使用 URL 遍历目录和子目录

如何使用Java创建目录和子目录结构?

如何使用php在父目录中创建子目录?

使用Python,如何将多个文件从FTP服务器上的子目录下载到本地计算机上的所需目录中?

如何在Linux操作系统中使用Java获取服务器时区信息

如何使用Java的目录流仅在目录中而不是其他子目录中获取文件/子目录

如何使用Solr中包含的jetty为目录及其文件和子目录提供服务?

如何请求子目录http GET请求网络

如何使用.htaccess将子目录重定向到根目录,参数为子目录

如何在Shell中进行子目录操作?

使用子目录时如何修复文件访问?

如何使用.htaccess重定向到子目录?

如何使用Jenkinsfile在子目录中构建Dockerfile