Top

Tags: Web-frontend

Frontend path: HTML + CSS

Dec 13, 2022 | 7796 views

#Web-frontend


- How to make a horizontal scroll flex box

Comments: 0

Setting Nginx Rate Limiting

Nov 10, 2021 | 1345 views

#Web-frontend


Two-Stage Rate Limiting

limit_req_zone $binary_remote_addr zone=ip:10m rate=5r/s;

server {
    listen 80;
    location / {
        limit_req zone=ip burst=12 delay=8;
        proxy_pass http://website;
    }
}

Refer to Rate Limiting with NGINX and NGINX Plus 

Comments: 0

Nginx whitelist specific IP

Oct 07, 2021 | 4353 views

#Web-frontend


Code example, whitelist keywords in URI for specific IP


server {
#...
    
    location / { 
        set $deny_access off;
        if ($remote_addr != "specific-ip-here") {
            set $deny_access on;
        }
        if ($uri ~ "^/(keyword1|keyword2)/" ) {
            set $deny_access on$deny_access;
        }
        # add_header X-debug-message "deny_access: $deny_access" always; # debug
        if ($deny_access = onon) { return 404; }
        # ...
    }
#...
}



Reference:

Comments: 0

JavaScript Programming Usage

Mar 01, 2021 | 1978 views

#Web-frontend


Get timestamp from datetime format string:

## JavaScript code example
time = "2020-02-27T16:00:00.000Z"
"2020-02-27T16:00:00.000Z"
timestamp = Date.parse(time) / 1000
1582819200

## verify above timestamp
date -d "1970-01-01 UTC 1582819200 seconds"
Thu Feb 27 16:00:00 UTC 2020

Refer to:

Comments: 0