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

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

Elite Donator
Apr 13, 2016
325
178
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.
 

Joshhh

Elite Donator
Apr 13, 2016
325
178
Have you tried changing from wss:// to ws:// in your renderer-config.json to see if that works instead?
 

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: 9

Joshhh

Elite Donator
Apr 13, 2016
325
178
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>
 

Joshhh

Elite Donator
Apr 13, 2016
325
178
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

Elite Donator
Apr 13, 2016
325
178
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

Elite Donator
Apr 13, 2016
325
178
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?
 

Simon2910

New Member
Nov 11, 2019
12
0
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?
Hey there. This is what happens when I created a test.html.
You must be registered for see images attach

This happens
 

Joshhh

Elite Donator
Apr 13, 2016
325
178
Hey there. This is what happens when I created a test.html.
You must be registered for see images attach

This happens

Have you saved that file inside your C:\inetput\wwwroot folder?

Also it could be a permission error maybe?

Make sure that the entire wwwroot folder and all of it's sub directories have the user: IIS_IUSRS + The Administrator account have full control of the folders.
 

Simon2910

New Member
Nov 11, 2019
12
0
Have you saved that file inside your C:\inetput\wwwroot folder?

Also it could be a permission error maybe?

Make sure that the entire wwwroot folder and all of it's sub directories have the user: IIS_IUSRS + The Administrator account have full control of the folders.
Hey there. It was in the wrong folder, my bad. Now it works for the test page. My permission weren't set for the wwwroot folder but it keeps on giving me the same error for the hotel itself.
You must be registered for see images attach
 

Joshhh

Elite Donator
Apr 13, 2016
325
178
Hey there. It was in the wrong folder, my bad. Now it works for the test page. My permission weren't set for the wwwroot folder but it keeps on giving me the same error for the hotel itself.
You must be registered for see images attach

What is your default directory for your site?

Make sure there is a web.config or a .htaccess file in there somewhere.
 


Write your reply...

Users who are viewing this thread

Top