> For the complete documentation index, see [llms.txt](https://abi.gitbook.io/net-core/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://abi.gitbook.io/net-core/11.-instalacion-en-linux/11.5-instalando-nginx.md).

# 17.5 Instalando Nginx y configurando tu servicio

Si no queremos que nuestros servicios esten disponibles necesitamos un servidor web, en este caso vamos a utilizar Nginx el cual me parece que tiene mas opciones que apache.

<https://www.nginx.com>

1\. Instalamos el servidor

```
sudo apt-get install nginx
```

2\. Iniciamos el servicio

```
sudo service nginx start
```

3\. Abrimos un navegador y tecleamos localhost nos debe aparecer la página de inicio de nginx

También si ponemos la ip de nuestro servidor linux en un navegador desde cualquier computadora, podemos ver la página de inicio de nginx.

En nuestro archivo */etc/nginx/sites-available/default* agregamos lo siguiente para que nos redireccione nuestros servicios de .net que están en el puerto 5000 al  puerto 8&#x30;*:*

```
server {
    listen        80;
    server_name   example.com *.example.com;
    location / {
        proxy_pass         http://localhost:5000;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection keep-alive;
        proxy_set_header   Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
    }
}
```

Detenemos e iniciamos el servicio de nginx

```
sudo service nginx stop
sudo service nginx start
```

El link con la documentación oficial es <https://docs.microsoft.com/es-mx/aspnet/core/host-and-deploy/linux-nginx>

Probamos nuestro servicio ya sea con la ip o con el dominio.&#x20;

<http://linuxapis.centralus.cloudapp.azure.com/swagger/index.html>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://abi.gitbook.io/net-core/11.-instalacion-en-linux/11.5-instalando-nginx.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
