wordpress网站如何清理js,wordpress 淘口令,免费流量,苏州住房和城乡建设厅网站一、首先在windows系统上下载并安装docker#xff0c;要下载windows版本
https://www.docker.com/products/docker-desktop/ PS#xff1a;安装过程中需要WSL#xff0c;我的是win11系统#xff0c;直接提示了我安装就可以下一步了。其他windows系统版本我不知道是否需要单…一、首先在windows系统上下载并安装docker要下载windows版本
https://www.docker.com/products/docker-desktop/ PS安装过程中需要WSL我的是win11系统直接提示了我安装就可以下一步了。其他windows系统版本我不知道是否需要单独安装。
安装完成docker后运行效果如下可以在官网注册账号 二、接下来的步骤咱们尽量不用命令因为是windows嘛全部图形化操作在docker这个应用程序中安装nginx 搜索nginx关键字然后最好选择刀客团队发布的最新版更安全和稳定。如果没有可以选第三方发布的用量比较大的。点击后面那个Pull等待获取完成就算安装完了。 三、此时可以运行nginx镜像生成一个应用容器了。 填写相关信息这里是个坑如果你点击docker程序提供的选择路径按钮将来运行会出错提示找不到路径所以得按如下的双斜杠形式填写 1.宿主机default.conf路径
C:\\Users\\mingyong.huang\\Desktop\\local\\default.conf
2.nginx运行时路径即 default.conf这里不明白是什么意思去查一下nginx使用方法这个路径基本都是固定的
/etc/nginx/conf.d/default.conf
3.宿主机网站文件路径即是你的vue项目被编译后的网站静态文件存放路径
C:\\Users\\mingyong.huang\\Desktop\\www\\site1\\dist
4.nginx运行时路径即 nginx运行网站的静态文件路径也是固定的同理不懂去查一下nginx使用方法
/usr/share/nginx/html
PS至于网上有说什么nginx运行时还有个 /etc/nginx.conf需要配置这次我没有用到也可以正常运行此处咱们先不管它等后期用到再说。
最后点击run按钮大功告成看下成果吧 此时你就能看到生成的容器了按照此方法你想生成多少个容器都可以。是不是比虚拟机更轻量级你还可以pull更多的应用比如redis、mysql等等。 完美运行网站 PSvue项目如果用的history模式而不是hash模式直接F5刷新页面会报错404解决办法就是在default.conf文件加一句话即可try_files $uri $uri/ /index.html;
这个文件我是放在C:\\Users\\mingyong.huang\\Desktop\\local\\default.conf的嘛所以打开后编辑保存重启此容器即可。
server {listen 80;listen [::]:80;server_name localhost;#access_log /var/log/nginx/host.access.log main;location / {root /usr/share/nginx/html;index index.html index.htm;# 避免f5刷新后404..try_files $uri $uri/ /index.html;}#error_page 404 /404.html;# redirect server error pages to the static page /50x.html#error_page 500 502 503 504 /50x.html;location /50x.html {root /usr/share/nginx/html;}# proxy the PHP scripts to Apache listening on 127.0.0.1:80##location ~ \.php$ {# proxy_pass http://127.0.0.1;#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000##location ~ \.php$ {# root html;# fastcgi_pass 127.0.0.1:9000;# fastcgi_index index.php;# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;# include fastcgi_params;#}# deny access to .htaccess files, if Apaches document root# concurs with nginxs one##location ~ /\.ht {# deny all;#}
}
全部完毕