# \#if

**URL:** https://community.nginx.org/tag/if/238.md

[Latest](https://community.nginx.org/latest.md) · [Categories](https://community.nginx.org/categories.md) · [Tags](https://community.nginx.org/tags.md)

---

## [Can't Reach Allowed File when My User Agent is Blocked](https://community.nginx.org/t/cant-reach-allowed-file-when-my-user-agent-is-blocked/5393)

<div class="topic-metadata">

**Author:** [@Melemin](https://community.nginx.org/u/Melemin)\
**Replies:** 4\
**Last updated:** [July 11, 2025, 10:11am UTC](https://community.nginx.org/t/cant-reach-allowed-file-when-my-user-agent-is-blocked/5393 "2025-07-11T10:11:25Z")

</div>

My nginx.conf file contains the following snippet: deny 192.168.1.1; if ($http\_user\_agent ~ "blockeduseragent") {return 403;} error\_page 403 /403-error-handler.html; location = /403-error-handler.html { al…
