Category: Web

Apache (16)
GlassFish (0)
HAProxy (2)
IIS (20)
Nginx (55)
Other (4)
Tomcat (17)

How to Restrict Access by Country Using Nginx GeoIP Module

This article describes how to use the GeoIP module to enable Nginx to restrict access by users from specific regions. Nginx must be compiled with the –with-http_geoip_module parameter.

1. First, check whether Nginx has been compiled with the GeoIP module nginx -V if you see – …

Nginx Rewrite for Special Characters

Original URL:
borrowinfo.page?borrow_id=2017121500000000000000005173
Target URL:
/invest/info?borrowId=2017121500000000000000005173

if ($request_uri ~* "^/borrowinfo.page/?borrow_id=(/d+)$") {

How to Start and Stop Nginx on Windows

Starting:

Navigate to the nginx directory and either double-click nginx.exe in the Nginx folder or run in cmd:
start nginx

Stopping
nginx -s stop
or
nginx -s quit
stop means to immediately stop nginx without saving related information

quit means to exit nginx normally, and …

Nginx proxy_pass URL With or Without Trailing Slash

How to Use Trailing Slashes in Nginx proxy_pass Correctly

When configuring proxy_pass in Nginx, adding a trailing slash (/) to the URL means it is treated as an absolute root path. In this case, Nginx will not forward the matched location path to the proxied server. Without the trailing slash, the matched path segment is also forwarded.

Test file is test.html, access http: …