Nginx's basic Windows configuration

Source: Internet
Author: User

Own little notes:


#user nobody;
Worker_processes 1;

#error_log Logs/error.log;
#error_log Logs/error.log Notice;
#error_log Logs/error.log Info;

#pid Logs/nginx.pid;


Events {
Worker_connections 1024;
}


HTTP {
Include 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 Logs/access.log Main;

Sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
Keepalive_timeout 65;

#gzip on;

# location is matched to the request, and when the match is on, the root+location as the benchmark is finally given/generic match. When a match succeeds, the match is stopped and the request is processed according to the current matching rule.

# = number is exactly match, no equals sign is similar match http://localhost:8000/ress this see 8000 is Z:\phhs_dev\phhs_ios\WebContent\xx, and then plus ress
# Ip_hash Fixed IP access to the same service to prevent session failure
Upstream Frontend {
Ip_hash;
Server 10.20.1.65:8080;
}
server {
Listen 8000;
server_name localhost;

#charset Koi8-r;

#access_log Logs/host.access.log Main;

Location/res {
Root Z:\phhs_dev\phhs_ios\WebContent\xx;

}

Location/{
Root Z:\phhs_dev\phhs_ios\WebContent;
}

#error_page 404/404.html;

# REDIRECT Server error pages to the static page/50x.html
#
Error_page 502 503 504/50x.html;
Location =/50x.html {
root HTML;
}

Location/phhs_ios {
Proxy_pass Http://frontend;
Proxy_next_upstream error timeout http_500 http_404;
Proxy_connect_timeout 1200;
Proxy_read_timeout 1200;
Proxy_send_timeout 1200;
Proxy_redirect off;
Proxy_buffering off;
Proxy_set_header Host $host;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
}
# 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$ {
# root HTML;
# Fastcgi_pass 127.0.0.1:9000;
# Fastcgi_index index.php;
# Fastcgi_param Script_filename/scripts$fastcgi_script_name;
# include Fastcgi_params;
#}

# Deny access to. htaccess files, if Apache ' s document Root
# concurs with Nginx ' s one
#
#location ~/\.ht {
# Deny All;
#}
}


# Another virtual host using mix of ip-, name-, and port-based configuration
#
#server {
# Listen 8000;
# Listen somename:8080;
# server_name somename alias Another.alias;

# location/{
# root HTML;
# index index.html index.htm;
# }
#}


# HTTPS Server
#
server {
Listen 8001;
server_name localhost;

SSL on;
Ssl_certificate CERT/SERVER.CRT;
Ssl_certificate_key Cert/server_nopwd.key;

Ssl_session_timeout 5m;

Ssl_protocols SSLv2 SSLv3 TLSv1;
Ssl_ciphers high:!anull:! MD5;
Ssl_prefer_server_ciphers on;

Location/{
Root Z:\phhs_dev\phhs_ios\WebContent;
}
}

}

Nginx's basic Windows configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.