# Reversed Proxy & Web Secure Socket It's useful to put your Exit Gateway behind a reversed proxy and have it accessible via `https` domain, where you can host a [landing page](../legal/landing-pages.md). The guide is right [below](#reversed-proxy). Another solution is to have a your Gateway behind WSS. With ongoing migration from `nym-gateway` to `nym-node --mode exit-gateway` we are working on a detailed guide for WSS setup. ## Reversed Proxy: Avril 14th Exit Gateways Guide ```admonish info This guide was created by a Nym node operator, Avril 14th as a part of [Nym Operators Community Counsel](../legal/community-counsel.md) The entire content of this page is under [Creative Commons Attribution 4.0 International Public License](https://creativecommons.org/licenses/by/4.0/). ``` The following snippet needs be modified as described below according to the public identity that you may want to show on this public notice, i.e. your graphics and your email. It would allow you to serve it as a landing page resembling the one proposed by [Tor](https://gitlab.torproject.org/tpo/core/tor/-/raw/HEAD/contrib/operator-tools/tor-exit-notice.html) but with all the changes needed to adhere to the Nym's operators case. [Avril 14th](https://avril14th.org/) is a team of professionals and optimistic realists eager to contribute to a future of privacy, decentralization and connectivity. ```admonish warning With a migration from `nym-gateway` to `nym-node --mode exit-gateway` the directory tree has been slightly changed. After the migration the configuration directory is in `~/.nym/nym-nodes/`. **The pathways and exact syntax in this guide is yet to be modified!** ``` When done with the customization needs as described below, you'll need to upload the file and reference it as the `landing_page_assets_path` on the `[http]` section of the config.toml file: ``` landing_page_assets_path = '' ``` ### HTML file customization - add your favicon logo on the line: ``` ``` and your header logo on the line: ``` ``` by either setting the URl to the image (if you're hosting it publicly, i.e. on your web server) ``` href="" ``` and ``` src="" ``` **or** by adding the image inline as base64 encoded image ``` href="href="data:image/x-icon;base64,AAABAAMA...."" ``` and ``` src="href="data:image/x-icon;base64,AAABAAMA...."" ``` - add the email address you're willing to use for being contacted. ``` maintainer ``` - If you're running the node within the US check the sections marked as FIXME, add your DNS name and uncomment those. *** ```html This is a NYM Exit Gateway

This is a NYM Exit Gateway

You are most likely accessing this website because you've had some issue with the traffic coming from this IP. This router is part of the NYM project, which is dedicated to create outstanding privacy software that is legally compliant without sacrificing integrity or having any backdoors. This router IP should be generating no other traffic, unless it has been compromised.

The Nym mixnet is operated by a decentralised community of node operators and stakers. The Nym mixnet is trustless, meaning that no parts of the system nor its operators have access to information that might compromise the privacy of users. Nym software enacts a strict principle of data minimisation and has no back doors. The Nym mixnet works by encrypting packets in several layers and relaying those through a multi-layered network called a mixnet, eventually letting the traffic exit the Nym mixnet through an exit gateway like this one. This design makes it very hard for a service to know which user is connecting to it, since it can only see the IP-address of the Nym exit gateway:

Illustration showing how a user might connect to a service through the Nym network. The user first sends their data through three daisy-chained encrypted Nym nodes that exist on three different continents. Then the last Nym node in the chain connects to the target service over the normal internet. The user This server Your service Nym network link Unencrypted link

Read more about how Nym works.

Nym relies on a growing ecosystem of users, developers and researcher partners aligned with the mission to make sure Nym software is running, remains usable and solves real problems. While Nym is not designed for malicious computer users, it is true that they can use the network for malicious ends. This is largely because criminals and hackers have significantly better access to privacy and anonymity than do the regular users whom they prey upon. Criminals can and do build, sell, and trade far larger and more powerful networks than Nym on a daily basis. Thus, in the mind of this operator, the social need for easily accessible censorship-resistant private, anonymous communication trumps the risk of unskilled bad actors, who are almost always more easily uncovered by traditional police work than by extensive monitoring and surveillance anyway.

In terms of applicable law, the best way to understand Nym is to consider it a network of routers operating as common carriers, much like the Internet backbone. However, unlike the Internet backbone routers, Nym mixnodes do not contain identifiable routing information about the source of a packet and do mix the user internet traffic with that of other users, making communications private and protecting not just the user content but the metadata (user's IP address, who the user talks to, when, where, from what device and more) and no single Nym node can determine both the origin and destination of a given transmission.

As such, there is little the operator of this Exit Gateway can do to help you track the connection further. This Exit Gateway maintains no logs of any of the Nym mixnet traffic, so there is little that can be done to trace either legitimate or illegitimate traffic (or to filter one from the other). Attempts to seize this router will accomplish nothing.

To decentralise and enable privacy for a broad range of services, this Exit Gateway adopts an Exit Policy in accordance with the Tor Null ‘deny’ list and the Tor reduced policy, which are two established safeguards.

That being said, if you still have a complaint about the router, you may email the maintainer. If complaints are related to a particular service that is being abused, the maintainer will submit that to the NYM Operators Community in order to add it to the Exit Policy cited above. If approved, that would prevent this router from allowing that traffic to exit through it. That can be done only on an IP+destination port basis, however. Common P2P ports are already blocked.

You also have the option of blocking this IP address and others on the Nym network if you so desire. The Nym project provides a web service to fetch a list of all IP addresses of Nym Gateway Exit nodes that allow exiting to a specified IP:port combination. Please be considerate when using these options.

``` *** ### Reverse proxy You may set up a [reverse proxy](https://www.nginx.com/resources/glossary/reverse-proxy-server/) in order to serve this landing page with proper SSL and DNS management, i.e. to resolve it to https://nym-exit. or https://nym-readme.. The following assumes that you're owning a domain and that you've already set the Let's Encrypt certificates on your hosting, and you've copied those on your Gateway, i.e. copy the two Let's Encript pem files on your Gateway's home folder. Else you may obtain a Let's Encrypt certificate using a -[-certonly procedure](https://eff-certbot.readthedocs.io/en/latest/using.html#getting-certificates-and-choosing-plugins). ``` sudo apt install nginx ``` If you're running your Gateway (you should...) exposing only the needed ports as listed [here](https://nymtech.net/operators/nodes/maintenance.html?highlight=port#ports), you need to add the Nginx service to your ufw configuration: ``` sudo ufw app list sudo ufw allow 'Nginx Full' sudo ufw reload ``` Disable the default Nginx landing page ``` sudo systemctl status nginx sudo unlink /etc/nginx/sites-enabled/default sudo systemctl restart nginx ``` Add your endpoint configuration to Nginx changing occurrencies below with your domain name, including the top-level domain, i.e. *avril4th.org* ``` sudo nano /etc/nginx/sites-available/nym-exit. ``` ``` server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name nym-exit.; ssl_certificate /fullchain.pem; ssl_certificate_key /privkey.pem; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; location / { proxy_pass http://127.0.0.1:8080; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } server { listen 80; listen [::]:80; if ($host = nym-exit.) { return 301 https://$host$request_uri; } server_name www.; return 301 https://$request_uri; } ``` ``` sudo ln -s /etc/nginx/sites-available/nym-exit. /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl restart nginx ``` When done with the customization needs as described below, you'll need to upload the file and reference it as the `landing_page_assets_path` on the `[http]` section of the config.toml file that you'll find in the `~/.nym/gateways//config/config.toml` file ``` nano ${HOME}/.nym/gateways//config/config.toml ``` change ``` landing_page_assets_path = '' ``` If you're running the Gateway as a service as described [here](https://nymtech.net/operators/nodes/maintenance.html#systemd) and [here](https://nymtech.net/operators/nodes/maintenance.html#following-steps-for-nym-nodes-running-as-systemd-service) you may just restart your service ``` service nym-gateway stop service nym-gateway start ``` and check for the page being served either checking the service logs ``` sudo journalctl -u nym-gateway.service | grep 8080 ``` where you should read out ``` ... Started NymNodeHTTPServer on 0.0.0.0:8080 ``` or just point your browser to the URI which you set above, such as https://nym-exit.