mac 上远程连接工具Parallels Client,直接app store 上面安装即可
1. 服务器上安装上nginx
Nginx下载里地址: http://nginx.org/en/download.html
nginx-1.24.0 在服务器上解压即可
2. 配置文件nginx.conf
```
worker_processes auto;
error_log logs/error.log;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
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 logs/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 500m;
client_body_buffer_size 512k;
# 代理的相关参数设置
proxy_connect_timeout 5;
proxy_read_timeout 60;
proxy_send_timeout 5;
proxy_buffer_size 16k;
proxy_buffers 4 64k;
proxy_busy_buffers_size 128k;
proxy_temp_file_write_size 128k;
# 启用gzip压缩,提高用户访问速度
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/css application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary on;
include mime.types;
default_type application/octet-stream;
include conf.d/*.conf;
}
3. 创建conf.d,然后创建对应的 域名配置文件
eg: www.abc.com.conf
server {
listen 80;
server_name wz.zhihuiqianyi.com;
location / {
root html;
index index.html index.htm;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,OPTIONS;
add_header Cache-Control 'no-cache, must-revalidate, proxy-revalidate, max-age=0';
expires 3d;
}
}
4.相关命令
cd 到nginx目录下
重载配置
nginx -s reload
停止(如果不放心是否已经关闭,可打开任务管理器手动结束任务)
nginx -s stop
启动
start nginx
页面闪一下就表示启动成功
访问: http://localhost