How to set up a retro in 2023 (IIS) (Nitro HTML5) - (Part 3)

Joe

Well-Known Member
Jun 10, 2012
4,083
1,911
I could use some help. I have finished the entirety of this tutorial and now my hotel gets stuck at 20% while loading in and spits out this error in the dev-console;

Access to fetch at ' ' from origin ' xxx.xxx.xxx.xxx' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

edit: removed public facing server IP
Edit the links in the nitro react folder, there’s 2 files to edit.
 

verki

New Member
Jan 2, 2023
8
0
Edit the links in the nitro react folder, there’s 2 files to edit.
Thank you for the reply, however I have edited the 2 files by renaming them properly and using the pre-made configs and filling in my domain in the required fields. Still no dice!
 

verki

New Member
Jan 2, 2023
8
0
I could use some help. I have finished the entirety of this tutorial and now my hotel gets stuck at 20% while loading in and spits out this error in the dev-console;

Access to fetch at ' ' from origin ' xxx.xxx.xxx.xxx' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

edit: removed public facing server IP
Bump?
 

Joshhh

Member
Apr 13, 2016
322
171
I could use some help. I have finished the entirety of this tutorial and now my hotel gets stuck at 20% while loading in and spits out this error in the dev-console;

Access to fetch at ' ' from origin ' xxx.xxx.xxx.xxx' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

edit: removed public facing server IP

In your main directory

If you use .htaccess add this into it;

Code:
<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
</IfModule>

If you use IIS,

  • Go into your IIS manager
  • Right click on the site your using
  • Goto the HTTP Headers Section (Might also be called HTTP Response Headers)
  • Click Add
  • Enter; Access-Control-Allow-Origin as the Header name
  • Enter; * as the value.

Then confirm both boxes and then try your client again.
 

nytje0118

New Member
Jan 1, 2023
7
0
When i try to get into the client, he say me connection error. How to fix?
Fixed, but now again connection error, dev tools telling me this (who can explain how to fix?):

[Nitro] [bS] Initializing Connection: wss://nitro.hab-world.nl:2096
renderer.0355b8fd.chunk.js:1 WebSocket connection to 'wss://nitro.hab-world.nl:2096/' failed:
createSocket @ renderer.0355b8fd.chunk.js:1
init @ renderer.0355b8fd.chunk.js:1
onInit @ renderer.0355b8fd.chunk.js:1
init @ renderer.0355b8fd.chunk.js:1
(anonymous) @ main.051cabb7.chunk.js:1
a @ renderer.0355b8fd.chunk.js:1
(anonymous) @ renderer.0355b8fd.chunk.js:1
c.emit @ vendors.4380b939.chunk.js:2
t.update @ vendors.4380b939.chunk.js:2
t.setRealSize @ vendors.4380b939.chunk.js:2
e.emit @ vendors.4380b939.chunk.js:2
e.resize @ vendors.4380b939.chunk.js:2
o @ vendors.4380b939.chunk.js:2
renderer.0355b8fd.chunk.js:1 [Nitro] [bS] Connection Error
renderer.0355b8fd.chunk.js:1 [Nitro] [bS] Connection Closed
 

Joshhh

Member
Apr 13, 2016
322
171
Have you tried changing from wss:// to ws:// in your renderer-config.json to see if that works instead?
 

nytje0118

New Member
Jan 1, 2023
7
0
Have you tried changing from wss:// to ws:// in your renderer-config.json to see if that works instead?
No, will try it now :)
Post automatically merged:

Have you tried changing from wss:// to ws:// in your renderer-config.json to see if that works instead?
Now i did that, but i still get the same error and also wss:// is showing on the error
 
Last edited:

Simon2910

New Member
Nov 11, 2019
12
0
We can see the server IP in your screenshot still, I would edit it out. Is the domain linked to Cloudflare which is then linked to your VPS? What happens when you navigate to the index of your server?
Hey there. My Cloudflare should be linked and seems to give no error at all.
(A screenshot of my dashboard, I guess if there was a Cloudflare error it should be on here.)
You must be registered for see images attach

Here's where I put my nameservers from Cloudflare at my Namecheap dashboard.
You must be registered for see images attach

A screenshot of my index page:
You must be registered for see images attach
 

Attachments

  • 1673027890377.png
    1673027890377.png
    93.2 KB · Views: 5

Joshhh

Member
Apr 13, 2016
322
171
I have fully dissabled windows defender firewall

I would make sure to go through the entire tutorial if you've followed that, and go from there? I'm unsure what else it could be, unless something to either do with your Cloudflare settings?
Post automatically merged:

Hey there. My Cloudflare should be linked and seems to give no error at all.
(A screenshot of my dashboard, I guess if there was a Cloudflare error it should be on here.)
You must be registered for see images attach

Here's where I put my nameservers from Cloudflare at my Namecheap dashboard.
You must be registered for see images attach

A screenshot of my index page:
You must be registered for see images attach

If you're using IIS, is your site hooked up to the correct directory (The correct path)?

Also maybe something wrong with either the web.config or .htaccess maybe?
 

Simon2910

New Member
Nov 11, 2019
12
0
If you're using IIS, is your site hooked up to the correct directory (The correct path)?

Also maybe something wrong with either the web.config or .htaccess maybe?

Hey there. I guess this is the right path my ISS should go to. Also, I didn't change anything to my web.config or .htaccess.
You must be registered for see images attach

My web.config and .htaccess:

Code:
<!--
    Rewrites requires Microsoft URL Rewrite Module for IIS
    Download: https://www.iis.net/downloads/microsoft/url-rewrite
    Debug Help: https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-failed-request-tracing-to-trace-rewrite-rules
-->
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="Imported Rule 1" stopProcessing="true">
          <match url="^(.*)/$" ignoreCase="false" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
          </conditions>
          <action type="Redirect" redirectType="Permanent" url="/{R:1}" />
        </rule>
        <rule name="Imported Rule 2" stopProcessing="true">
          <match url="^" ignoreCase="false" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.php" />
        </rule>
        <rule name="ReverseProxyInboundRule1" stopProcessing="true">
            <match url="(.*)" />
            <action type="Rewrite" url="http://localhost:8080/{R:1}" />
            <conditions>
                <add input="{QUERY_STRING}" pattern="/?figure=(.*)" />
            </conditions>
        </rule>
      </rules>
            <outboundRules>
                <preConditions>
                    <preCondition name="ResponseIsHtml1">
                        <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                    </preCondition>
                </preConditions>
            </outboundRules>
    </rewrite>
        <directoryBrowse enabled="false" />
  </system.webServer>
</configuration>
Code:
<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
 

nytje0118

New Member
Jan 1, 2023
7
0
I would make sure to go through the entire tutorial if you've followed that, and go from there? I'm unsure what else it could be, unless something to either do with your Cloudflare settings?
Post automatically merged:



If you're using IIS, is your site hooked up to the correct directory (The correct path)?

Also maybe something wrong with either the web.config or .htaccess maybe?
I followed everything, idk what it can be..
 

Joshhh

Member
Apr 13, 2016
322
171
Hey there. I guess this is the right path my ISS should go to. Also, I didn't change anything to my web.config or .htaccess.
You must be registered for see images attach

My web.config and .htaccess:

Code:
<!--
    Rewrites requires Microsoft URL Rewrite Module for IIS
    Download: https://www.iis.net/downloads/microsoft/url-rewrite
    Debug Help: https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-failed-request-tracing-to-trace-rewrite-rules
-->
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="Imported Rule 1" stopProcessing="true">
          <match url="^(.*)/$" ignoreCase="false" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
          </conditions>
          <action type="Redirect" redirectType="Permanent" url="/{R:1}" />
        </rule>
        <rule name="Imported Rule 2" stopProcessing="true">
          <match url="^" ignoreCase="false" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.php" />
        </rule>
        <rule name="ReverseProxyInboundRule1" stopProcessing="true">
            <match url="(.*)" />
            <action type="Rewrite" url="http://localhost:8080/{R:1}" />
            <conditions>
                <add input="{QUERY_STRING}" pattern="/?figure=(.*)" />
            </conditions>
        </rule>
      </rules>
            <outboundRules>
                <preConditions>
                    <preCondition name="ResponseIsHtml1">
                        <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                    </preCondition>
                </preConditions>
            </outboundRules>
    </rewrite>
        <directoryBrowse enabled="false" />
  </system.webServer>
</configuration>
Code:
<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

What happens if you change the directory to C:\inetpub\wwwroot\atomcms? And then try a file in there that works via your browser aka something like hotelname.com/file.html and see if anything pops up?

It could also be a installation of IIS gone wrong somewhere?
 

verki

New Member
Jan 2, 2023
8
0
In your main directory

If you use .htaccess add this into it;

Code:
<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
</IfModule>

If you use IIS,

  • Go into your IIS manager
  • Right click on the site your using
  • Goto the HTTP Headers Section (Might also be called HTTP Response Headers)
  • Click Add
  • Enter; Access-Control-Allow-Origin as the Header name
  • Enter; * as the value.

Then confirm both boxes and then try your client again.
I have added the 'Access-Control-Allow-Origin' Header with '*' as the value. Issue still persists as it was before. Any ideas?
 

Joshhh

Member
Apr 13, 2016
322
171
Have you tried restarting the IIS site through the IIS manager? Have you also cleared your cache?
 

verki

New Member
Jan 2, 2023
8
0
Have you tried restarting the IIS site through the IIS manager? Have you also cleared your cache?
Cleared browser cache, restarted the IIS website and the host machine. No dice. Pegged at 20% on the loading bar. Very same 'Access to fetch at ... from origin '....' has been blocked by CORS policy.'
Post automatically merged:
 

Joshhh

Member
Apr 13, 2016
322
171
Cleared browser cache, restarted the IIS website and the host machine. No dice. Pegged at 20% on the loading bar. Very same 'Access to fetch at ... from origin '....' has been blocked by CORS policy.'
Post automatically merged:

Is there a website to see this on or anything like that?
 

Users who are viewing this thread

Top