# How do I do what I did in htaccess in nginx?

**URL:** https://meta.discourse.org/t/how-do-i-do-what-i-did-in-htaccess-in-nginx/80772
**Category:** Self-hosting
**Created:** [2월 16, 2018, 7:55오후 UTC](https://meta.discourse.org/t/how-do-i-do-what-i-did-in-htaccess-in-nginx/80772 "2018-02-16T19:55:48Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Overgrow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/overgrow/32/478189_2.png) [@Overgrow](https://meta.discourse.org/u/Overgrow)
#### Post date: [2월 16, 2018, 7:59오후 UTC](https://meta.discourse.org/t/how-do-i-do-what-i-did-in-htaccess-in-nginx/80772/2 "2018-02-16T19:59:29Z")

</div>

Use nginx outside of docker container (see [Run other websites on the same machine as Discourse](https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247)) and you can rewrite those URLs using nginx configuration.

Syntax is:

```plaintext
server {
  server_name sub.domain.com;
  rewrite ^(.*) http://12.34.56.78/a/particular/path/ permanent;
}

```

---

_[View the full topic](https://meta.discourse.org/t/how-do-i-do-what-i-did-in-htaccess-in-nginx/80772)._
