getPluginSpecs error

bron this is what I’m trying to tell you…

nginx is going to send anything nftea.app to localhost:3000 where the main app is running…

tried it the way you suggested like this

server {
             # Binds the TCP port 80.
             # Defines the domain or subdomain name. 
       # If no server_name is defined in a server block then 
             # Nginx uses the 'empty' name
       root /var/www/html/nftea;
       server_name nftea.app www.nftea.app;
             # Redirect the traffic to the corresponding 
             # HTTPS server block with status code 301

        location / {

        proxy_pass       http://localhost:3000;
        proxy_set_header Upgrade    $http_upgrade;
        proxy_set_header Connection $http_connection;
        proxy_set_header Host       $host;
    }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/nftea.app/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/nftea.app/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot




}

server {

server_name nftea.app/server;

location / {

        proxy_pass       http://localhost:1337/server;
        proxy_set_header Upgrade    $http_upgrade;
        proxy_set_header Connection $http_connection;
        proxy_set_header Host       $host;
    }

}

first step is to make the server accessible over the internet, without the application that connects to the server, then you will use that server url in your application

you don’t have to make them both at the same time to work on the same url

you guys gave folks a ton more work to do…

I’ve been at this for 6 hours now… need a break… I’m not paying for an extra server just to get this going… I’ll look at other solutions for now and re-write the entire freaking application after all this extra stuff…

you don’t need another server, the front end application and the parse server have to run on different locations on the same server, like the frontend on https://nftea.app/front_end and the server url on https://nftea.app/server and the front end will have to connect to the server url

you can also test it locally until you make it work

cool…
moved it to a different domain
futuro.money runs the parse server…
nftea.app is the front…

  <MoralisProvider appId="001" serverUrl="https://futuro.money" initializeOnMount={true}>
            <Layout>
              <Component {...pageProps} />
            </Layout>
        </MoralisProvider>
error Error: XMLHttpRequest failed: "Unable to connect to the Parse API"

this one seems close to how it should work

the other one still tries to connect to http://localhost:1337/server/functions/getPluginSpecs

changed to

server {
             # Binds the TCP port 80.
             # Defines the domain or subdomain name. 
       # If no server_name is defined in a server block then 
             # Nginx uses the 'empty' name
       server_name futuro.money www.futuro.money;
             # Redirect the traffic to the corresponding 
             # HTTPS server block with status code 301

        location / {

        proxy_pass       http://localhost:1337;
        proxy_set_header Upgrade    $http_upgrade;
        proxy_set_header Connection $http_connection;
        proxy_set_header Host       $host;
    }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/futuro.money/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/futuro.money/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

<MoralisProvider appId="001" serverUrl="https://futuro.money/" initializeOnMount={true}>

looks like it works in browser… not in script…

same cannot connect to pase API error

It looks like you have to change the server url in front end code

change to what?
I’ve changed
REACT_APP_SERVER_URL=http://futuro.money/server

changed this

        <MoralisProvider appId="001" serverUrl="http://futuro.money/server" initializeOnMount={true}>

change what exactly?

it’s calling the localhost:1337 from RESTController.js?26fd in node_modules/moralis/v-1

anyway to overide this?

also is there a bug bounty for this… this was never going to work with nginx… it’s been hours just to find out its something that was never going to work

If it’s still trying to call localhost:1337, it means you haven’t deployed the changes properly to use futuro.money/server. It is still using the localhost server you set previously.

maybe it’s nextjs…

if there’s nothing else besides

        <MoralisProvider appId="001" serverUrl="http://www.futuro.money/server" initializeOnMount={true}>
            <Layout>
              <Component {...pageProps} />
            </Layout>
        </MoralisProvider>

and the .env.local file

REACT_APP_SERVER_URL=http://futuro.money
REACT_APP_APPLICATION_ID=001

then what else am I missing?

you see the error is coming from right?
ā€œnode_modules/moralis-v1/lib/browser/RESTController.js (445:0)ā€

This is how YOUR moralis-v1 works…

you guys know .env is only accessible server side with nextjs right?

you are all all over the freaking place with your docs… your primary docs suggest nextjs… now you are using things that don’t work with the what you recommend… I’ve wasted a whole freaking day on this…

What is the actual code you’re using? In this code you have hardcoded the appId and serverUrl but you’re posting about using environment variables - there’s no use of process.env here. Just hardcode them for now, don’t worry about the use of .env.local.

This is how YOUR moralis-v1 works…

Yes but your NFTea.app is still trying to connect to localhost:1337. This is from your own configuration (in MoralisProvider). Check the Moralis code for your deployed site for which serverUrl is actually being used. Make sure you’re not using another MoralisProvider or Moralis.start code anywhere.

my friend…
I’ve told you the same thing a few different times…

regardless what is
here… <MoralisProvider appId="001" serverUrl="http://www.futuro.money/server" initializeOnMount={true}>

Your node_modules/moralis-v1/lib/browser/RESTController.js (445:0)
script is ignoring that…

it’s looking for what is in the .env file…

var url = _CoreManager.default.get('SERVER_URL');

it’s not reading the .env file… so it defaults to localhost:1337

that’s not going to work with nginx…

this is either because of nextjs not giving it access to the .env file…
or whatever reason… it’s not me telling it to use localhost…

if we are on the same page now… can I please get a solution?

Hey did u try using NEXT_PUBLIC_ instead of REACT_APP_ as the prefix of your nextjs app, otherwise it won’t load your env variables

yes I did… doesn’t work