NGINX does not correctly reverse proxy web application requests to their relative location

I have two web applications running on my home server, one on port 7001 and the other on port 3578.

Both of these apps have REST API routes, all of which start with /api.

My NGINX configuration is as follows for the two location blocks:

location /deals/ {
    include /config/nginx/proxy.conf;
    proxy_cache_bypass $http_upgrade;
    proxy_pass http://192.168.1.65:7001/;
    proxy_redirect off;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Proto https;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Server $host;
}

location /speed/ {
    include /config/nginx/proxy.conf;
    proxy_cache_bypass $http_upgrade;
    proxy_pass http://192.168.1.65:3578/;
    proxy_redirect off;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Proto https;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Server $host;
}

This is the result of an entire afternoon of Google search and around search …

192.168.1.65 is the home network IP address of my home server.

The problem what i'm faced with is that when these web apps make API calls, they don't make the calls relative to their locations (new proxies), but rather from the domain url .

When I navigate to https://my-domain.com/deals and https://my-domain.com/speed, I can see my web applications respectively.

BUT data is never loaded because they both call my-domain.com/api instead of my-domain.com/deals/api or my-domain.com/speed/api. I can see it in the network tab of Chrome developer tools, both return 404.

When I navigate to 192.168.1.65:7001, I can see my web applications and data loaded correctly.

When I manually type in the address bar https://my-domain.com/speed/api/example, I can see that it can respond correctly to the GET request with a status code 200.

How can I get them to make calls from their respective locations?

python – Pandas will not repair the CSV file correctly

I am trying to process a CSV which contains the data on coronaviruses by province, the problem that I have is that it has stopped working for me, and that & # 39; is because it has stopped reading the CSV data correctly, I have the following:

import pandas as pd
csv = pd.read_csv('2020-03-25.csv', delimiter = ',')

Where the first 2 lines are (they are practically the same):
Line 1:

Ciudad,Latitude,Longitude,Código país,Diagnosticados,Activos,Recuperados,Muertos,IA,Notas,,,

Line 2:

Almería,36.8304075,-2.4637136,Casos detectados,115,105,5,5,"34,57",,,,

The headers (line 1), it separates them correctly, the problem is that it saves all the lines of the city.

I'm adding the first 2 lines of 1 version that worked for me:
Line 1:

Ciudad,Latitude,Longitude,Código país,Diagnosticados,Activos,Recuperados,Muertos,IA,Notas,,,

Line 2:

Almería,36.8304075,-2.4637136,Casos detectados,91,86,72¹,5,"28,52",¹La Junta no especifica el lugar de las altas y algunas de ellas corresponden a seguimiento domiciliario.,,,

I can't find the differences between the two, changing that you have more data, but after all, with commas it shouldn't be a problem.

Thank you in advance.

apache2 – The subdomain does not redirect correctly when using HTTPS

When you use a subdomain, it redirects to my default page / domain. This only happens when using HTTPS .. for example

https://forums.example.net – takes me to example.net … BUT
http://bans.example.net – take me to the prohibitions site (the right site)

I am using Apache 2 and Ubuntu 18.04 using my own VPS. ((I also have 2 additional subdomains registered in the domain, but I think this may be a problem with one of my Apache configurations!)) Or a Cloudflare problem.

CONFIGURATION OF ACTIVATED SITES

RewriteEngine on
RewriteCond %{SERVER_NAME} =bans.example.net (OR)
RewriteCond %{SERVER_NAME} =status.example.net (OR)
RewriteCond %{SERVER_NAME} =example.net (OR)
RewriteCond %{SERVER_NAME} =forums.example.net
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} (END,NE,R=permanent)


# vim: syntax=apache ts=4 sw=4 sts=4 sr noet


    DocumentRoot /var/www/html/example.net/
    ServerName example.net

    
        Options +Indexes +FollowSymLinks +MultiViews +Includes
        AllowOverride FileInfo Options
        Order allow,deny
        allow from all
    
RewriteEngine on
RewriteCond %{SERVER_NAME} =example.net
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} (END,NE,R=permanent)



    DocumentRoot /var/www/html/bans.example.net/
    ServerName bans.example.net

    
        Options +Indexes +FollowSymLinks +MultiViews +Includes
        AllowOverride FileInfo Options
        Order allow,deny
        allow from all
    
RewriteEngine on
RewriteCond %{SERVER_NAME} =example.net (OR)
RewriteCond %{SERVER_NAME} =bans.example.net (OR)
RewriteCond %{SERVER_NAME} =forums.example.net
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} (END,NE,R=permanent)

SSL CONFIG INSIDE ACTIVATED SITES



    DocumentRoot /var/www/html/example.net/
    ServerName example.net

    
        Options +Indexes +FollowSymLinks +MultiViews +Includes
        AllowOverride FileInfo Options
        Order allow,deny
        allow from all
    


Include /etc/letsencrypt/options-ssl-apache.conf
ServerAlias forums.example.net
ServerAlias bans.example.net
ServerAlias status.example.net
SSLCertificateFile /etc/letsencrypt/live/bans.example.net-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/bans.example.net-0001/privkey.pem




    DocumentRoot /var/www/html/forums.example.net/
    ServerName forums.example.net

    
        Options +Indexes +FollowSymLinks +MultiViews +Includes
        AllowOverride FileInfo Options
        Order allow,deny
        allow from all
    






    DocumentRoot /var/www/html/bans.example.net/
    ServerName bans.example.net

    
        Options +Indexes +FollowSymLinks +MultiViews +Includes
        AllowOverride FileInfo Options
        Order allow,deny
        allow from all
    




Google Search Console – Your sitemap or sitemap index file does not correctly declare the namespace!

Here is my site map, it starts like this:








    
        https://autocostos.info/AR
        weekly
        

            
            
            
            
            
            
            
            
            

But the Google search console insists that

Your sitemap or sitemap index file does not correctly declare the namespace

They just give an example on line 16:
Line 16
Parent tag: url
Tag: link

Line 16 corresponds to

What am i doing wrong?

opengl – How to correctly reset vertex attributes after modification

I am trying to use the same vertex shader for two different use cases to preserve memory, but I have problems where changes from a shader run are passed to the next run, even after being reset. Specifically, I am trying to use the shader to display both a regular texture, while modifying the vertex attributes in some cases to display parts of a texture. The problem is that this "cropping" of the texture is applied to the texture which must be displayed at 100%.

Here's what it looks like, where the sprite on the right is drawn first:
Application screenshot

The two textures only show part of their actual images, but only the left one should. Curiously, the one on the right shows full texture for a second, before being replaced by what is shown. This tells me that the vertex attributes of the first sprite are changed by the second sprite (left), but I don't know how to reset them. Here is my vertex shader:

#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec2 aTexCoord;

out vec2 TexCoord;

uniform mat4 transform;
uniform mat4 view;
uniform mat4 projection;

void main()
{
    gl_Position = projection * view * transform * vec4(aPos, 1.0);
    TexCoord = aTexCoord;
}

Here is how I modify the attributes of the vertices:

void setSelection(Quad selection) {
        vertices(3) = selection.x + selection.w;
        vertices(4) = selection.y + selection.h;
        vertices(8) = selection.x + selection.w;
        vertices(9) = selection.y;
        vertices(13) = selection.x;
        vertices(14) = selection.y;
        vertices(18) = selection.x;
        vertices(19) = selection.y + selection.h;
};
...
float vertices(20) = {
          // positions         // texture coords
          0.5f,  0.5f, 0.0f,   1.0f, 1.0f, // top right
          0.5f, -0.5f, 0.0f,   1.0f, 0.0f, // bottom right
         -0.5f, -0.5f, 0.0f,   0.0f, 0.0f, // bottom left
         -0.5f,  0.5f, 0.0f,   0.0f, 1.0f  // top left
};

This code modifies the texture coordinates of the vertices table displayed. They are applied with this code:

void Sprite::render() {
    // Set shader uniforms if the shader is initialized
    if (shader != nullptr) {
        applyTransforms();
        shader->useShader();
        shader->setMat4("transform", trans);
        shader->setVec4("color", color.asVec4());
        shader->setMat4("view", Camera::getLookMat());
    }

    glBindBuffer(GL_ARRAY_BUFFER, vbo);
    glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices);
    glBindBuffer(GL_ARRAY_BUFFER, 0);

    tex->bind();

    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo);
    glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0);
}

However, if I have two objects (both instances of the same class), one with a modified array (left) and one with an unmodified array (right, as shown in the image), the modified table takes precedence, and I can & # 39; I don't know how to prevent it from being changed without using another shader object, but I don't want to do that. Is there something missing that would allow me to change the attributes between drawing cycles?

php – Pass the html menu to WordPress correctly with wp_nav_menu ();

I have an HTML menu and would like to know how to organize the classes and the identifier in a wp_nav_menu so that it looks the same and I can add items from the WordPress menu manager.

My html code is:

   
      
      

Nginx reverse proxy does not display correctly

I'm pretty new using nginx and I've been playing with it for about a few days, I've watched a few tutorials and still need to enter a lot of concepts, having said that, I do have a server proxy that uses a self-signed certificate that I want to access through a reverse proxy. My configuration is as follows:

server {
    listen 8080;
    error_log /var/log/nginx/ISE.log warn;

    location / {

        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header SSL_PROTOCOL $ssl_protocol;

        proxy_pass https://10.1.3.10:8443/portal/PortalSetup.action?portal=a2f2ebc0-5f8c-11e9-a9a4-62e74e19c19f;

        }}

when i connect to the server via reverse proxy, the web page does not display properly. From what I understand, I can say that Nginx could be fecth, the links also don't work properly. I have seen the source code of the web server which is used by proxy and uses relative links, I don't know if this is causing the problem or not. My first difficulty was because the proxy server uses a self-signed certificate, so I added this to the configuration:

proxy_ssl_trusted_certificate /etc/nginx/trusted_ca_cert.crt;
proxy_ssl_verify       on;
proxy_ssl_verify_depth 2;

and got an http 502 error :-]

Could someone explain to me why the web page is not displaying properly? and if it has to do with the fact that the proxied server uses a self-signed certificate, if so how should my configuration be?

Thanks in advance

How can I broadcast a raw hexadecimal transaction and verify that it is correctly posted to bitcoinj?

I have generated a raw transaction and I am getting its hexadecimal form, how can I spread it in bitcoinj and check that it is correctly broadcast? Now, I can only post to the website after generating the raw transaction.

node.js – NodeJS route modified to call a function that recursively calls s3.ListObjects but not sure if it works correctly / could be simplified

Route before modification (calls s3.listObjects once so cannot retrieve> 1000 objects):

server.get('/v1/api/project/', (request, response, next) => {
  s3.listObjects({ Bucket: BUCKET, Prefix: '', Delimiter: "https://codereview.stackexchange.com/" }, (err, data) => {
    if (err) {
      console.error(err);
      response
        .status(err.statusCode ? err.statusCode : 500)
        .send(err.message);
      return;
    }
    if (data.CommonPrefixes) {
      const items = data.CommonPrefixes
        .map(r => r.Prefix)
        .map(prefix => prefix.split("https://codereview.stackexchange.com/")(0))
        .map(prefix => {
          return { prefix };
        });
      response.send({ items, count: items.length });
    }
  });
});

Route after modification and new function that I added to retrieve all the objects from the bucket s3:

server.get('/v1/api/project/', async(request, response, next) => {
  let allCommonPrefixes;
  try {
    allCommonPrefixes = await getAllCommonPrefixes({ Bucket: BUCKET, Prefix: '', Delimiter: "https://codereview.stackexchange.com/" });
  } catch(err) {
    console.error(err);
    response
        .status(err.statusCode ? err.statusCode : 500)
        .send(err.message);
    return;
  }
  if (allCommonPrefixes) {
    const items = allCommonPrefixes
        .map(r => r.Prefix)
        .map(prefix => prefix.split("https://codereview.stackexchange.com/")(0))
        .map(prefix => {
          return { prefix };
        });
    response.send({ items, count: items.length });
  }
});

async function getAllCommonPrefixes(params, allCommonPrefixes = ()) {
  try {
    await new Promise((resolve, reject) => {
      s3.listObjects(params, (err, data) => {
        if (err) {
          reject(err);
        }
        allCommonPrefixes.push(...data.CommonPrefixes);
        let contents = data.Contents;
        if (data.IsTruncated) {
          params.Marker = data.NextMarker ? data.NextMarker : contents(contents.length-1).Key;
          return getAllCommonPrefixes(params, allCommonPrefixes);
        }
        return allCommonPrefixes;
      });
    });
  } catch(err) {
    throw err;
  }
}

How can I prove it correctly?

Yes $ f (0) = g (0) $ and $ f & # 39; (0)> g & # 39; (0) $ then there is $ n> 0 $ so that $ f (x) ≥g (x) $ $ ∀x ∈ (0, n) $.