已经google,bing,baidu,yahoo都没有找到解决方案,请大神求助
nginx吧
全部回复
仅看楼主
level 1
我的目的是让服务器放下两个域名
并且这两个域名下的项目文件夹不在同一个文件夹下面
两个域名下的项目语言分别使用php和java
php已经使用phpstudy自动配置成功,2楼附上部分源码
求现在怎么用nginx代理tomcat的8080端口(访问java的域名直接会访问到java项目的文件夹)
求nginx吧大神教配置
2016年04月20日 07点04分 1
level 1
这是phpstudy自动生成的:
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
root "D:/phpStudy/WWW";
location / {
index index.html index.htm index.php l.php;
autoindex off;
}
#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 ^((?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;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
2016年04月20日 07点04分 2
level 1
思路我自己摸索了一下,应该是这样的:
nginx的作用就是访问服务器的ip的时候,nginx就会使用服务器的默认80端口
然后nginx会转发请求至已经配置好的php项目,至于nginx是怎么解析php的我并不知道
现在就是卡在了nginx怎么把请求转发至tomcat这个容器。
2016年04月20日 07点04分 3
level 1
2016年04月20日 07点04分 4
level 1
~
2016年04月20日 08点04分 5
level 1
~~
2016年04月20日 12点04分 6
level 5
接受到的jsp请求,直接转发tomcat监听端口
2016年05月14日 14点05分 7
1