• window下phpstudy的nginx配置虚拟主机


    由于很长时间没有配置Apache,虽然说知道怎么配置nginx,但是还是花费了一些时间这次记下来下次直接用

    在其他选项文件菜单中->打开配置文件->选择vhosts-conf

    nginx的话使用

    复制代码
    复制代码
    server {
            listen       80;
            server_name  你的虚拟目录名称;
            root   "你要操作的目录路径";
            location / {
                index  index.html index.htm index.php;
                #autoindex  on;
                if ($request_filename !~ (static|robots/.txt|index/.php.*)) {
                    rewrite ^/(.*)$ /index.php?$1 last;
                    break;
                    }
    
            }
            location ~ .php(.*)$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_split_path_info  ^((?U).+.php)(/?.+)$;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                fastcgi_param  PATH_INFO  $fastcgi_path_info;
                fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
                include        fastcgi_params;
            }
    }
    复制代码
    复制代码

    之后最重要一点就是DNS解析了:在C:WindowsSystem32driversetc下打开hosts

    加入你配置的域名解析到本地的代码例如

    127.0.0.1       localhost                               这个是默认有的
    127.0.0.1       www.mycomment.com

     apache的虚拟主机的话代码可以参考

    复制代码
    复制代码
    <VirtualHost *:80>
    ServerAdmin fudesign2008@163.com
    DocumentRoot "F:workspacevimYNotesrc"
        ServerName editor.fuyg.cn
        ServerAlias editor.fuyg.cn
        ErrorLog "logs/dummy-host.localhost-error.log"
        CustomLog "logs/dummy-host.localhost-access.log" combined
        <Directory "F:workspacevimYNotesrc">
            Options Indexes FollowSymLinks
            AllowOverride All 
            Order allow,deny
            Allow from all
        </Directory>
    </VirtualHost>
  • 相关阅读:
    Spring 中的邮件任务
    Spring 定时任务
    java中同步交互 与 异步交互
    Springboot 版本包冲突
    Derby 配置环境变量
    Springboot中的Web服务Tomcat改为Jetty
    二叉树中和为某一值的路径
    0-Java中this和super的用法总结
    树9:二叉搜索树的后序遍历
    位运算-输入一个整数,输出该数二进制表示中1的个数。其中负数用补码表示。
  • 原文地址:https://www.cnblogs.com/ghjbk/p/6859982.html
Copyright © 2020-2023  润新知