编程爱好者之家
在防火墙添加需要的端口
文件路径:/etc/sysconfig/iptables
-A INPUT -s 192.168.1.3 -p tcp -m tcp --dport 83 -j ACCEPT //-s 192.168.1.3 是指定固定ip访问
端口添加好之后,重启防火墙
把要走代理的域名的nginx复制一份出来www.codelovers.cn.83.conf
以下是我的配置文件:
server {
listen 83;//端口号就是刚才在防火墙添加的端口号
server_name www.codelovers.cn codelovers.cn ;
root /home/code/www.codelovers.cn;
index index.php index.html;
fastcgi_intercept_errors on;
error_page 500 502 503 504 /50x.html;
error_page 404 /404.html;
location = /50x.html {
root /var/www/nginx-default;
}
include enable-php.conf;
if ($host = 'itbiancheng.com') {
rewrite ^/(.*)$ http://www.itbiancheng.com/$1 permanent;
}
location ~* ^/(uploadimg|uploads)/.*.(php|php5)$ {
deny all;
}
if (!-e $request_filename)
{
rewrite ^/([a-zA-Z]+)$ /$1/ permanent;
}
access_log off;
}代理机nginx设置:
server {
listen 80;
server_name www.itbiancheng.com itbiancheng.com;
location / {
access_log off;
proxy_pass http://192.168.1.3:83;//192.168.1.3 根据实际情况更改成自己的IP,端口号是上面设置的
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Could not resolve host: mirrors.cloud.aliyuncs.com; Unknown error
permission denied是什么意思呢-怎么解决permission denied的问题
linux安装ipset封ip
centos7安装配置svn服务器
RHSA-2021:0221: sudo 安全更新-中危
网站配置SSL证书(https),使网站可以通过https访问
CentOS 7 安装 LNMP 环境
centos7安装memcached以及php7的memcached拓展
阿里云服务器怎么整体迁移到华为云服务器
linux通过rsync命令将一个服务器上文件备份到另一个服务器上