ddddd

PHPCUSTOM下nginx配置https证书

作者:程序员11 时间:2021-09-13 人气:691 QQ交流群\邮箱:1003265987@qq.com
PHPCUSTOM下nginx配置https证书
要展示的内容

打开对应的phpcustom服务,进行证书配置,并重启nginx网站服务之后,再测试进行访问

12.png

公钥和私钥对应的是,腾讯云ssl里面创建下载的如下图

12.png

nginx.conf 文件内容如下:


#user  nobody;

worker_processes  auto;


error_log  logs/error.log;

#error_log  logs/error.log  notice;

#error_log  logs/error.log  info;

worker_rlimit_nofile 100000;

#pid        logs/nginx.pid;


events {

     worker_connections 40960;

}


http {

    include       mime.types;

    #server_tokens off;

    default_type  application/octet-stream;

    server_names_hash_bucket_size 128;

    #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;

     client_max_body_size  300m;

     client_body_buffer_size 60k;

     client_body_timeout 60;

     client_header_buffer_size 64k;

     client_header_timeout 60;

     open_file_cache_valid 30s;

     open_file_cache_min_uses 1;

     open_file_cache max=102400 inactive=20s;

 

     keepalive_requests 100;

     large_client_header_buffers 4 64k;

     reset_timedout_connection on;

     send_timeout 60;

     sendfile_max_chunk 512k;

     #keepalive_timeout  0;

     keepalive_timeout 120;

     fastcgi_connect_timeout 300;

     fastcgi_send_timeout 300;

     fastcgi_read_timeout 300;

     fastcgi_buffer_size 64k;

     fastcgi_buffers 4 64k;

     fastcgi_busy_buffers_size 128k;

     fastcgi_temp_file_write_size 128k;

   #gzip on;




    # 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;

    #    }

    #}

    map $time_iso8601 $logdate {

        '~^(?<ymd>\d{4}-\d{2}-\d{2})' $ymd;

        default                       'date-not-found';

    }

    include nginx-vhosts-phpwnmp.conf;

}


nginx-vhosts-phpwnmp内容如下:

#当前文件为phpcustom集成环境Nginx站点管理,如有疑问请到官网phpcustom.com查看相关教程--------------Lccee备注 

include nginx-vhosts-ip.conf;





#站点名称:phpMyAdmin5

 server {

        listen       8011;

        access_log  logs/phpMyAdmin_mysql5.access.log;

        error_log  logs/phpMyAdmin_mysql5.error.log;

        root C:/PHPCUSTOM/phpmyadmin/phpMyAdmin_mysql5;

            

        #绑定域名

    


        location / { 

             #这里是此站点的伪静态设置文件(注意:Nginx的伪静态每次修改后必须重启方能生效,如果任何一个站点的伪静态配置错误,网站将无法正常访问!)

             include C:/PHPCUSTOM/phpmyadmin/phpMyAdmin_mysql5/nginx.htaccess;

             index  index.html index.htm index.php;

             autoindex on;

                     

        }


    location ~ .php(.*)$ {

             root C:/PHPCUSTOM/phpmyadmin/phpMyAdmin_mysql5;

             fastcgi_pass   127.0.0.1:9018;

             fastcgi_split_path_info ^(.+.php)(.*)$;

             fastcgi_param PATH_INFO $fastcgi_path_info;

             fastcgi_index  index.php;

             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name; 

             include        fastcgi_params; 

                        

        }

    }

#网站备注:仅适用Mysql5.1-Mysql5.6





#站点名称:phpMyAdmin8

 server {

        listen       8012;

        access_log  logs/phpMyAdmin_mysql8.access.log;

        error_log  logs/phpMyAdmin_mysql8.error.log;

        root C:/PHPCUSTOM/phpmyadmin/phpMyAdmin_mysql8;

            

        #绑定域名

    


        location / { 

             #这里是此站点的伪静态设置文件(注意:Nginx的伪静态每次修改后必须重启方能生效,如果任何一个站点的伪静态配置错误,网站将无法正常访问!)

             include C:/PHPCUSTOM/phpmyadmin/phpMyAdmin_mysql8/nginx.htaccess;

             index  index.html index.htm index.php;

             autoindex on;

                     

        }


    location ~ .php(.*)$ {

             root C:/PHPCUSTOM/phpmyadmin/phpMyAdmin_mysql8;

             fastcgi_pass   127.0.0.1:9058;

             fastcgi_split_path_info ^(.+.php)(.*)$;

             fastcgi_param PATH_INFO $fastcgi_path_info;

             fastcgi_index  index.php;

             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name; 

             include        fastcgi_params; 

                        

        }

    }

#网站备注:仅适用Mysql5.5-Mysql8





#站点名称:蓝风铃舞蹈

 server {

        listen       80;

        access_log  logs/h5.access.log;

        error_log  logs/h5.error.log;

        root C:/projects/online_learning/h5;

            

        #绑定域名

        server_name   www.lanfl.com;


        location / { 

             #这里是此站点的伪静态设置文件(注意:Nginx的伪静态每次修改后必须重启方能生效,如果任何一个站点的伪静态配置错误,网站将无法正常访问!)

             include C:/projects/online_learning/h5/nginx.htaccess;

             index  index.html index.htm index.php;

             autoindex on;

                     

        }


    location ~ .php(.*)$ {

             root C:/projects/online_learning/h5;

             fastcgi_pass   127.0.0.1:8080;

             fastcgi_split_path_info ^(.+.php)(.*)$;

             fastcgi_param PATH_INFO $fastcgi_path_info;

             fastcgi_index  index.php;

             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name; 

             include        fastcgi_params; 

                        

        }

    }

#网站备注:蓝风铃舞蹈





#站点名称:蓝风铃服务端

 server {

        listen       81;

        access_log  logs/online_learning_server.access.log;

        error_log  logs/online_learning_server.error.log;

        root C:/projects/online_learning_server;

            

        #绑定域名

        server_name   www.lflserver.com;


        location / { 

             #这里是此站点的伪静态设置文件(注意:Nginx的伪静态每次修改后必须重启方能生效,如果任何一个站点的伪静态配置错误,网站将无法正常访问!)

             include C:/projects/online_learning_server/nginx.htaccess;

             index  index.html index.htm index.php;

             autoindex on;

                     

        }


    location ~ .php(.*)$ {

             root C:/projects/online_learning_server;

             fastcgi_pass   127.0.0.1:8001;

             fastcgi_split_path_info ^(.+.php)(.*)$;

             fastcgi_param PATH_INFO $fastcgi_path_info;

             fastcgi_index  index.php;

             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name; 

             include        fastcgi_params; 

                        

        }

    }

#网站备注:蓝风铃服务端


最后配置完,重新启动就可以了。





温馨提示:

欢迎阅读本文章,觉得有用就多来支持一下,没有能帮到您,还有很多文章,希望有一天能帮到您。

PHPCUSTOM下nginx配置https证书---相关文章


评论区

ddddd

程序员-学习的网站-想学习编程的码农可以进来看看

首页

视频教程

购物车

我的订单