国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home Operation and Maintenance Nginx How to install nginx1.10.1 reverse proxy in Windows to access IIS website

How to install nginx1.10.1 reverse proxy in Windows to access IIS website

May 23, 2023 pm 05:40 PM
windows nginx iis

First go to the official website to download the software package, unzip it, it is best not to have Chinese characters in the path

nginx configuration path problem

Because in windows You can use "\", "\\", or "/" as the path separator for the file path. But "\" is the most likely to cause problems, so try to avoid using it.

Do not add path, otherwise it will cause an error, the config file path cannot be found

For example, I unzip it on the e drive

cmd command Locate the folder where nginx.exe is located cd e:\worksoftware\nginx-1.10.1
Then execute, first ensure that the nginx.conf file configuration is OK

In fact, the most important and important thing about nginx The main job is the configuration file. There is nothing else that our application developers need to pay attention to, unless we want to modify the underlying source code.
nginx.conf is configured as follows:

#user nobody; 
worker_processes 1; 
#工作進(jìn)程的個(gè)數(shù),可以配置多個(gè) 
 
#全局錯(cuò)誤日志及pid文件 
error_log /worksoftware/nginx-1.10.1/logs/error.log; 
#error_log logs/error.log notice; 
#error_log logs/error.log info; 
 
pid  /worksoftware/nginx-1.10.1/logs/nginx.pid; 
 
 
events { 
 worker_connections 1024; #單個(gè)進(jìn)程最大連接數(shù)(最大連接數(shù)=連接數(shù)*進(jìn)程數(shù)) 
} 
 
#設(shè)定http服務(wù)器,利用它的反向代理功能提供負(fù)載均衡支持 
http { 
 include  mime.types; #設(shè)定配置文件位置,這里的conf是指nginx.conf所在的目錄,也可以用絕對(duì)路徑指定其他地方的配置文件 
 default_type application/octet-stream; #默認(rèn)類型-8進(jìn)制文件流 
 
 #設(shè)定日志格式 
 #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 
 #     '$status $body_bytes_sent "$http_referer" ' 
 #     '"$http_user_agent" "$http_x_forwarded_for"'; 
  
 #設(shè)定訪問(wèn)日志 
 #access_log /worksoftware/nginx-1.10.1/logs/access.log main; 
 
 sendfile  on; #是否激活sendfile()函數(shù),比默認(rèn)模式更有效率 
 #tcp_nopush  on; #將http響應(yīng)頭壓縮到一個(gè)包中發(fā)送,僅在sendfile開(kāi)啟時(shí)才能配合使用 
 
 #連接超時(shí)時(shí)間 
 #keepalive_timeout 0; 
 keepalive_timeout 65; 
 
 gzip on; #啟用gzip壓縮 
 
 #服務(wù)器的集群 
 #設(shè)定負(fù)載均衡的服務(wù)器列表 支持多組的負(fù)載均衡,可以配置多個(gè)upstream 來(lái)服務(wù)于不同的server. 
 #nginx 的 upstream 支持 幾 種方式的分配 
 #1)、輪詢(默認(rèn)) 每個(gè)請(qǐng)求按時(shí)間順序逐一分配到不同的后端服務(wù)器,如果后端服務(wù)器down掉,能自動(dòng)剔除。 
 #2)、weight 指定輪詢幾率,weight和訪問(wèn)比率成正比,用于后端服務(wù)器性能不均的情況。 跟上面樣,指定了權(quán)重。 
 #3)、ip_hash 每個(gè)請(qǐng)求按訪問(wèn)ip的hash結(jié)果分配,這樣每個(gè)訪客固定訪問(wèn)一個(gè)后端服務(wù)器,可以解決session的問(wèn)題。 
 #4)、fair   
 #5)、url_hash #urlhash 
  
 #upstream imicrosoft.net 
 #{ 
  #服務(wù)器集群名字 
  #服務(wù)器配置 weight是權(quán)重的意思,權(quán)重越大,分配的概率越大。 
  #server 192.98.12.60:1985 weight=3 max_fails=2 fail_timeout=30s; 
  #server 192.98.12.42:8086 weight=3 max_fails=2 fail_timeout=30s; 
   
  #weigth參數(shù)表示權(quán)值,權(quán)值越高被分配到的幾率越大 
  #1.down 表示單前的server暫時(shí)不參與負(fù)載 
  #2.weight 默認(rèn)為1.weight越大,負(fù)載的權(quán)重就越大。  
  #3.backup: 其它所有的非backup機(jī)器down或者忙的時(shí)候,請(qǐng)求backup機(jī)器。所以這臺(tái)機(jī)器壓力會(huì)最輕。   
  #本例是指在同一臺(tái)服務(wù)器,多臺(tái)服務(wù)器改變ip即可  
 # server 127.0.0.1:8055 weight=4 down; 
 # server 127.0.0.1:8010 weight=5 backup; 
 #} 
  
  
 upstream localhost 
 {  
  server 127.0.0.1:9000 weight=3 max_fails=2 fail_timeout=200s; 
  server 127.0.0.1:8086 weight=5 max_fails=2 fail_timeout=200s; 
 } 
  
  
 #當(dāng)前的nginx的配置,代理服務(wù)器的地址,即nginx安裝的服務(wù)器地址、監(jiān)聽(tīng)端口、默認(rèn)地址, 
 #設(shè)定虛擬主機(jī),默認(rèn)為監(jiān)聽(tīng)80端口 
 server 
 { 
  listen  9090; #偵聽(tīng)9090端口 
  #對(duì)于server_name,如果需要將多個(gè)域名的請(qǐng)求進(jìn)行反向代理,可以配置多個(gè)server_name來(lái)滿足要求 
  server_name localhost; #當(dāng)前服務(wù)的域名 
   
  charset utf8; 
  #charset koi8-r; 
  
  #設(shè)定本虛擬主機(jī)的訪問(wèn)日志 
  #access_log logs/host.access.log main; 
 
   
  #如果訪問(wèn) /images/*, /js/*, /css/* 資源,則直接取本地文件,不用轉(zhuǎn)發(fā)。 
  #但如果文件較多效果不是太好。 
  #location ~ .*\.(jpg|jpeg|gif|css|png|ico|html)$ 
  #{ 
  # expires 30d; 
  # root /nginx-1.10.1;#root: 
  # break; 
  #} 
   
  #對(duì) "/" 啟用負(fù)載均衡 
  location / { 
    
   root html;  #默認(rèn)主頁(yè)目錄在nginx安裝目錄的html子目錄 
   
   index index.html index.htm index.aspx; #沒(méi)有索引頁(yè)時(shí),羅列文件和子目錄 
   #proxy_pass http://www.imicrosoft.net; #跟載均衡服務(wù)器的upstream對(duì)應(yīng)     
   autoindex on; #沒(méi)有索引頁(yè)時(shí),羅列文件和子目錄 
   
   #保留用戶真實(shí)信息 
   proxy_redirect off; #url不跳轉(zhuǎn) 
   proxy_set_header host $host; 
   proxy_set_header x-real-ip $remote_addr; 
   proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; 
   #緩沖區(qū)代理緩沖用戶端請(qǐng)求的最大字節(jié)數(shù),可以理解為先保存到本地再傳給用戶 
   # client_body_buffer_size 128k; 
   # #跟后端服務(wù)器連接超時(shí)時(shí)間 發(fā)起握手等候響應(yīng)超時(shí)時(shí)間 
   # proxy_connect_timeout 12; 
   # #連接成功后 等待后端服務(wù)器響應(yīng)時(shí)間 其實(shí)已進(jìn)入后端的排隊(duì)之中等候處理 
   # proxy_read_timeout 90; 
   # #代理請(qǐng)求緩存區(qū) 這個(gè)緩存區(qū)間會(huì)保存用戶的頭信息一共nginx進(jìn)行規(guī)則處理 一般只要能保存下頭信息即可 
   # proxy_send_timeout 90; 
   # #同上 告訴nginx保存單個(gè)用的幾個(gè)buffer最大用多大空間 
   # proxy_buffer_size 4k; 
   # proxy_buffers 4 32k; 
   # #如果系統(tǒng)很忙的時(shí)候可以申請(qǐng)國(guó)內(nèi)各大的proxy_buffers 官方推薦 *2 
   # proxy_busy_buffers_size 64k; 
   # #proxy 緩存臨時(shí)文件的大小 
   proxy_temp_file_write_size 64k; 
   # proxy_next_upstream error timeout invalid_header http_500 http_503 http_404; 
   proxy_max_temp_file_size 128m; 
   #啟動(dòng)代理 
   proxy_pass http://localhost; 
   client_max_body_size 10m; #允許客戶端請(qǐng)求的最大單個(gè)文件字節(jié)數(shù) 
  } 
 
   
   
  #示例一 
  #location / { 
  #  proxy_pass http://imicrosoft.net; 
  #  
  #  proxy_redirect default; 
  #   
  #  proxy_set_header host $host; 
  #  proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; 
  #} 
   
  #示例二 
  #location /tileservice { 
  #  proxy_pass http://cluster/mongotileservice/tileservice; 
  #  proxy_set_header host $host; 
  #  proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; 
  #} 
   
   
  #error_page 404    /404.html; 
 
  # redirect server error pages to the static page /50x.html 
  # 
  error_page 500 502 503 504 /50x.html; 
  location = /50x.html { 
   root html; 
  } 
 
  # proxy the php scripts to apache listening on 127.0.0.1:80 
  #對(duì) "/xxxxx.php" 啟用負(fù)載均衡 
  #location ~ \.php$ { 
  # proxy_pass http://127.0.0.1; 
  #} 
   
  #location /baidu 
  #{ 
  #proxy_pass http://www.google.com; 
  #proxy_set_header host $host; 
  #proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; 
  #} 
   
  # 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  443 ssl; 
 # server_name localhost; 
 
 # ssl_certificate  cert.pem; 
 # ssl_certificate_key cert.key; 
 
 # ssl_session_cache shared:ssl:1m; 
 # ssl_session_timeout 5m; 
 
 # ssl_ciphers high:!anull:!md5; 
 # ssl_prefer_server_ciphers on; 
 
 # location / { 
 #  root html; 
 #  index index.html index.htm; 
 # } 
 #} 
 
}

The result is as shown in the figure:

How to install nginx1.10.1 reverse proxy in Windows to access IIS website

How to install nginx1.10.1 reverse proxy in Windows to access IIS website

How to install nginx1.10.1 reverse proxy in Windows to access IIS website

##iis site

How to install nginx1.10.1 reverse proxy in Windows to access IIS website

The above is the detailed content of How to install nginx1.10.1 reverse proxy in Windows to access IIS website. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Windows can't access shared folder on network Windows can't access shared folder on network Jun 30, 2025 pm 04:56 PM

When encountering the "Windowscan'taccesssharedfolderonnetwork", you can usually solve the problem through the following steps: 1. Turn on the network discovery and file sharing function and turn off password protection; 2. Make sure that the target computer is enabled to share and set the correct permissions; 3. Check the firewall rules and service status to ensure that it allows shared access; 4. Use the credential manager to add network credentials for long-term and stable connection.

Windows 'Getting Windows ready, Don't turn off your computer' stuck Windows 'Getting Windows ready, Don't turn off your computer' stuck Jun 30, 2025 pm 05:18 PM

When you encounter Windows stuck in the "GettingWindowsready, Don't turnoff your computer" interface, you should first confirm whether it is really stuck; 1. Observe whether the hard disk indicator light is flashing, 2. Check whether the fan sound has changed, 3. Wait at least 30 to 60 minutes to ensure that the system has enough time to complete the update operation.

Windows clipboard history not working Windows clipboard history not working Jun 30, 2025 pm 05:14 PM

When the Windows clipboard history is not working, you can check the following steps: 1. Confirm that the clipboard history function is enabled, the path is "Settings>System>Clipboard", and if it is not enabled, Win V will not respond; 2. Check whether the copy content type is limited, such as large images, special formats or file paths may not be saved; 3. Ensure that the system version supports it, Windows 101809 and above, and some enterprise versions or LTSC do not support it; 4. Try to restart the ClipboardUserService service or end the clipups.exe process; 5. Clear the clipboard cache or reset the settings, close and then turn on the "Clipboard History" or run the "echooff|clip" command to clean up the cache

How to fix a stuck Windows restart screen? How to fix a stuck Windows restart screen? Jun 30, 2025 pm 05:10 PM

Don't rush to reinstall the system when the computer is stuck in the Windows restart interface. You can try the following methods first: 1. Force shutdown and then restart. Apply to the situation where the update is stuck. Repeat two or three times or can skip the lag; 2. Enter the safe mode to check, select Start repair or system restore through troubleshooting. If you can enter safe mode, it may be a driver or software conflict; 3. Use the command prompt to repair the system files, enter the three commands sfc and dism in the recovery environment to repair the damaged files; 4. Check the recently installed hardware or driver, unplug the non-essential devices or uninstall the new driver to eliminate incompatibility issues. In most cases, the above steps can solve the phenomenon of restart lag. If it really doesn’t work, consider reinstalling the system and paying attention to backing up data in advance.

How to run an app as an administrator in Windows? How to run an app as an administrator in Windows? Jul 01, 2025 am 01:05 AM

To run programs as administrator, you can use Windows' own functions: 1. Right-click the menu to select "Run as administrator", which is suitable for temporary privilege hike scenarios; 2. Create a shortcut and check "Run as administrator" to achieve automatic privilege hike start; 3. Use the task scheduler to configure automated tasks, suitable for running programs that require permissions on a scheduled or background basis, pay attention to setting details such as path changes and permission checks.

'This operation has been cancelled due to restrictions in effect on this computer' Windows fix 'This operation has been cancelled due to restrictions in effect on this computer' Windows fix Jun 30, 2025 pm 04:47 PM

The error "This operation has been cancelled because of restrictions on the computer" is usually caused by permissions or policy restrictions. Solutions include: 1. Check whether to use an administrator account, and if not, switch or change the account type; 2. Run the program as an administrator, or set a shortcut to always run as an administrator; 3. Check Group Policy restrictions, set suspicious policies to "not configured" or "disabled", but be careful that there is no Group Policy Editor for the Home Edition; 4. If registry editing is disabled, you can re-enable it by creating a .reg file; 5. Troubleshoot third-party software interference, temporarily close the security software or management startup items. Trying the above methods in order usually solves the problem.

Windows stuck on 'undoing changes made to your computer' Windows stuck on 'undoing changes made to your computer' Jul 05, 2025 am 02:51 AM

The computer is stuck in the "Undo Changes made to the computer" interface, which is a common problem after the Windows update fails. It is usually caused by the stuck rollback process and cannot enter the system normally. 1. First of all, you should wait patiently for a long enough time, especially after restarting, it may take more than 30 minutes to complete the rollback, and observe the hard disk light to determine whether it is still running. 2. If there is no progress for a long time, you can force shut down and enter the recovery environment (WinRE) multiple times, and try to start repair or system restore. 3. After entering safe mode, you can uninstall the most recent update records through the control panel. 4. Use the command prompt to execute the bootrec command in the recovery environment to repair the boot file, or run sfc/scannow to check the system file. 5. The last method is to use the "Reset this computer" function

How to fix a corrupted user profile in Windows? How to fix a corrupted user profile in Windows? Jun 30, 2025 pm 05:11 PM

Corruption of user profile can be solved by creating a new account, using system tools to repair, manually migrating data, and modifying the registry. After confirming the problem, you can try the following methods in turn: 1. Create a new local account to determine whether it is the original account problem; 2. Use sfc/scannow and DISM tools to repair the system files; 3. Create a new user through the administrator account and manually migrate the old account files (including the hidden AppData directory); 4. Advanced users can try to locate the ProfileList item in the registry editor, check and repair the abnormal ProfileImagePath entry, and backup the registry before the operation.

See all articles