MAC自定义域名访问nginx服务器的thinkphp项目
来源:互联网 发布:免费的约会软件 编辑:程序博客网 时间:2024/06/14 02:06
1.首先,我们编辑mac系统的hosts文件:
sudo vim /etc/hosts
在里面增加一个自定义域名,比如:192.168.1.13(本机ubuntu服务器的IP) www.ubuntublog.com
2.我nginx安装在 /usr/local/nginx . 然后我们修改配置文件:/usr/local/nginx/conf/nginx.conf 。 部分配置文件如下:
这是一个最简单的配置,更多需求配置可以查看nginx官方文档:
server { listen 80; server_name localhost,www.ubuntublog.com; #charset koi8-r; #access_log logs/host.access.log main; root /usr/local/nginx/html/blogforit/; location / { index index.php; //我的项目隐藏了index.php,所以下面需要做一个rewrite if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; } break; } #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 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$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; include /usr/local/nginx/conf/fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} }
- MAC自定义域名访问nginx服务器的thinkphp项目
- web项目的Linux服务器部署发布以及域名访问
- thinkphp访问域名隐藏
- 我的服务器开发之路-thinkphp和子域名的结合省略项目名
- 使用自定义域名访问Tomcat项目
- 本地用自定义域名方式访问项目
- 将Tomact与域名绑定,通过域名访问本地服务器上自己开发的J2EE项目
- Nginx 禁止直接使用IP或未绑定的域名访问Web服务器
- 模拟的nginx 配置为域名的的方式直接访问项目
- Nginx禁止通过IP,未绑定域名访问服务器
- Nginx学习---用不同域名访问同一台机器的不同项目
- Nginx学习---用不同域名访问同一台机器的不同项目
- nginx服务器下部署ThinkPHP的配置
- Nginx定义域名访问
- 【097】Nginx实现一台服务器,两个域名发布不同的前端项目,并且两个域名都用80端口。
- ThinkPHP下的域名直接访问主页问题解决方案
- 本地电脑使用自定义域名访问项目+配置项目
- Nginx 下部署ThinkPHP项目的办法
- 解决问题前的一些思考
- android apk反编译打包签名
- Zend Framework 引导启动 – Bootstrapping
- pagination 插件用法
- 分享最新20套漂亮的网页背景纹理素材
- MAC自定义域名访问nginx服务器的thinkphp项目
- PayPal付款状态解释-中英文对照
- 嵌入式软件工程师/linux c程序员 面试经验自我总结
- Zend Framework 控制器 Controller
- 最近几天做不合格面试官的经历和感悟
- Zend Framework 数据库和Models
- 分享35套很不错的抽象纹理背景素材
- C语言解释器-20 终章:运行
- Zend Framework布局和视图 Layouts views