Welcome! Log In Create A New Profile

Advanced

User-Agent in Nginx

Posted by prashantgupta1805 
User-Agent in Nginx
March 13, 2019 10:49AM
I am new in nginx and want to configure allow or disallow specific user-agent for specific directory.
Previously I was use apache for this and use below configuration.

/etc/httpd/conf.d/user_agent.conf
SetEnvIfNoCase User-Agent "^.*vlc.*" dvc
SetEnvIfNoCase User-Agent "^.*AppleCoreMedia.*" iphone


<Directory "/var/www/html/movies">
Order deny,allow
Deny from all
Allow from env=dvc 127.0.0.1
</Directory>

<Directory "/var/www/html/movies/trailers">
Order deny,allow
Deny from all
Allow from env=iphone
</Directory>

Please help me in nginx and suggest alternative solution in nginx.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 257
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready