您的位置:首页 > 其它

[Mac OS] Safari 使用扩展插件“微软翻译”一键翻译网页 (二)

2015-06-08 16:50 435 查看
1.使用fedora源
2.安装nginx
3.测试配置文件
4.编辑配置文件
5.启动nginx
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm yum install nginx
nginx -t
vim /etc/nginx/nginx.conf
service nginx start

[root@mail nginx]# cat /etc/nginx/nginx.conf

user              nginx;
worker_processes  2;

error_log  /var/log/nginx/error.log;

pid        /var/run/nginx.pid;

worker_rlimit_nofile 65535;

events {
worker_connections  65535;
}

http {
include       /etc/nginx/mime.types;
default_type  application/octet-stream;

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log  /var/log/nginx/access.log  main;

sendfile        on;
keepalive_timeout  65;

upstream tomcat {
server localhost:8081;
}
upstream apache {
server localhost:8088;
}

server {
listen       80 default;
server_name  _;

location / {
root   /usr/share/nginx/html;
index  index.jsp index.html index.htm;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://tomcat; }

}
server{

listen 80;
server_name angroid.com on-z.com;
location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://apache; }

}

# Load config files from the /etc/nginx/conf.d directory
include /etc/nginx/conf.d/*.conf;

}

iptables设置
iptables -I INPUT -p tcp -s 0/0 --dport 80 -j ACCEPT
iptables -I OUTPUT -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: