I would like to paste an url in my app and navigate to that specific path. For example.
<code>my-serve.com/products?id=14cSscsZS
</code>
<code>my-serve.com/products?id=14cSscsZS
</code>
my-serve.com/products?id=14cSscsZS
Actually, if I paste this in my web browser nginx changes the url to my-serve.com/?id=14cSscsZS
and shows me te init page allocated in /
.
This is my nginx.conf
file:
<code>server {
listen 443 ssl;
server_name myserver.mx;
ssl_certificate /etc/nginx/conf.d/certificados/app.crt.crt;
ssl_certificate_key /etc/nginx/conf.d/certificados/app.key.key;
root /usr/share/nginx/html;
location / {
index index.html index.htm silent-refresh.html;
try_files $uri $uri/ /index.html$is_args$args; # Pasa parámetros a index.html
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# Proxy para la API
location /api {
proxy_pass http://pm2:9000;
proxy_http_version 1.1;
# Configuración adicional para proxy si es necesario (ej., timeouts, buffers)
# proxy_connect_timeout 60s;
# proxy_send_timeout 120s;
# proxy_read_timeout 120s;
# proxy_buffer_size 16k;
# proxy_buffers 4 32k;
# proxy_busy_buffers_size 64k;
# proxy_temp_file_write_size 64k;
}
}
</code>
<code>server {
listen 443 ssl;
server_name myserver.mx;
ssl_certificate /etc/nginx/conf.d/certificados/app.crt.crt;
ssl_certificate_key /etc/nginx/conf.d/certificados/app.key.key;
root /usr/share/nginx/html;
location / {
index index.html index.htm silent-refresh.html;
try_files $uri $uri/ /index.html$is_args$args; # Pasa parámetros a index.html
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# Proxy para la API
location /api {
proxy_pass http://pm2:9000;
proxy_http_version 1.1;
# Configuración adicional para proxy si es necesario (ej., timeouts, buffers)
# proxy_connect_timeout 60s;
# proxy_send_timeout 120s;
# proxy_read_timeout 120s;
# proxy_buffer_size 16k;
# proxy_buffers 4 32k;
# proxy_busy_buffers_size 64k;
# proxy_temp_file_write_size 64k;
}
}
</code>
server {
listen 443 ssl;
server_name myserver.mx;
ssl_certificate /etc/nginx/conf.d/certificados/app.crt.crt;
ssl_certificate_key /etc/nginx/conf.d/certificados/app.key.key;
root /usr/share/nginx/html;
location / {
index index.html index.htm silent-refresh.html;
try_files $uri $uri/ /index.html$is_args$args; # Pasa parámetros a index.html
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# Proxy para la API
location /api {
proxy_pass http://pm2:9000;
proxy_http_version 1.1;
# Configuración adicional para proxy si es necesario (ej., timeouts, buffers)
# proxy_connect_timeout 60s;
# proxy_send_timeout 120s;
# proxy_read_timeout 120s;
# proxy_buffer_size 16k;
# proxy_buffers 4 32k;
# proxy_busy_buffers_size 64k;
# proxy_temp_file_write_size 64k;
}
}
This file it’s stored outside the docker image:
<code>volumes:
- ./nginx_configuracion:/etc/nginx/conf.d
</code>
<code>volumes:
- ./nginx_configuracion:/etc/nginx/conf.d
</code>
volumes:
- ./nginx_configuracion:/etc/nginx/conf.d
Can I redirect all url (my-serve.com/products?id=14cSscsZ
) to go directly in my angular app?