我用的是 http://blog.linuxeye.com/31.html 这个 “LNMP、LAMP、LANMP一键安装脚本” 的默认配置,网站是 example.com,主页是 http://example.com/index.php。
nginx 配置是
# ....../nginx/conf/vhost/example.com.conf
server {
listen 80;
server_name example.com;
access_log off;
index index.html index.htm index.jsp index.php;
root /home/wwwroot/example.com;
location / {
try_files $uri @apache;
}
location @apache {
internal;
proxy_pass http://127.0.0.1:8080;
}
location ~ .*\.(php|php5)?$ {
proxy_pass http://127.0.0.1:8080;
}
}
apache 配置是
# ......apache/conf/vhost/example.com.conf
<VirtualHost *:8080>
ServerAdmin [email protected]
DocumentRoot "/home/wwwroot/example.com"
ServerName example.com
<Directory "/home/wwwroot/example.com">
SetOutputFilter DEFLATE
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.html index.php
</Directory>
</VirtualHost>
生成了 example.com.csr 和 example.com.key ,给钱买了个证书 example.com.crt 。
我应该怎样添加配置?比如说添加删除 apache nginx 的功能和写虚拟主机设置等等?使得又可以访问 http://example.com 又可以访问 https://example.com ?
谢谢各位!
nginx 配置是
# ....../nginx/conf/vhost/example.com.conf
server {
listen 80;
server_name example.com;
access_log off;
index index.html index.htm index.jsp index.php;
root /home/wwwroot/example.com;
location / {
try_files $uri @apache;
}
location @apache {
internal;
proxy_pass http://127.0.0.1:8080;
}
location ~ .*\.(php|php5)?$ {
proxy_pass http://127.0.0.1:8080;
}
}
apache 配置是
# ......apache/conf/vhost/example.com.conf
<VirtualHost *:8080>
ServerAdmin [email protected]
DocumentRoot "/home/wwwroot/example.com"
ServerName example.com
<Directory "/home/wwwroot/example.com">
SetOutputFilter DEFLATE
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.html index.php
</Directory>
</VirtualHost>
生成了 example.com.csr 和 example.com.key ,给钱买了个证书 example.com.crt 。
我应该怎样添加配置?比如说添加删除 apache nginx 的功能和写虚拟主机设置等等?使得又可以访问 http://example.com 又可以访问 https://example.com ?
谢谢各位!