Skip to content

Category: Security

Build options to improve the performance and security of Nginx

Without any optimization option, the compiler’s goal is to reduce the cost of compilation and to make debugging produce the expected results. Statements are independent: if you stop the program with a breakpoint between statements, you can then assign a new value to any variable or change the program counter to any other statement in…

Blocking access by user agent in Nginx

How to block access by user agent in Nginx. In this configuration, i will use ngx_http_map_module. Inside http section: include /etc/nginx/blacklist; Inside server section (virtual host). We will return 444 status code. if ($block_ua) { return 444; } The blacklist file (example) map $http_user_agent $block_ua { default 0; ~*profound 1; ~*scrapyproject 1; ~*netcrawler 1; ~*nmap…

How to apply restrictions per virtualhost in apache

If you are running apache on MPM Prefork, you can apply php restrictions for security or additional settings such as memory limit. Also, you can disable functions or php engine per directory or virtualhost. Standard virtualhost example: <VirtualHost *> DocumentRoot /home/tex/www/example.com ServerName example.com ServerAlias example.com ServerAdmin admin@example.com ErrorLog ${APACHE_LOG_DIR}/example.com-error_log CustomLog ${APACHE_LOG_DIR}/example.com-access_log combined </VirtualHost>   Virtualhost…