I have installed sitecore 10.0.3 on premise on dev server (remote desktop) and created next.js Jss app and connected the app with sitecore, now i have the app running and i can access the site from inside remote desktop, also i can access the sitecore CMS from out side the remote desktop but i can not access the site or experience editor for pages from out side the remote deskop.

how shall I deploy the app to make the site public from out side the remote desktop?

note : I am using next self rendering host loaclhost:3000 enter image description here

2 Answers 2


You can deploy NextJS to IIS 1- install URLRewrite and IISNode 2- add web.config

        <rule name="myapp">
          <match url="/*" />
          <action type="Rewrite" url="server.js" />

    <iisnode node_env="production" nodeProcessCommandLine="&quot;C:\Program Files\nodejs\node.exe&quot;" interceptor="&quot;%programfiles%\iisnode\interceptor.js&quot;" />

    <location path="" overrideMode="Deny">
      <add name="iisnode" path="server.js" verb="*" modules="iisnode" />
            <smtp from="">
                <network defaultCredentials="false" host="" password="" port="25" userName="" />

3- add server.js

{ createServer } = require('http')
const { parse } = require('url')
const next = require('next')
const cors = require('cors');


const dev = process.env.NODE_ENV !== 'production'
const port = process.env.PORT || 3000;
const app = next({ dev })

const handle = app.getRequestHandler()

const corsOptions = {
  origin: process.env.SITECORE_API_HOST,

app.prepare().then(() => {
  createServer((req, res) => {
        const parsedUrl = parse(req.url, true)
        const { pathname, query } = parsedUrl       
        if (pathname === '/a') {
          app.render(req, res, '/a', query)
        } else if (pathname === '/b') {
          app.render(req, res, '/b', query)
        } else {
          handle(req, res, parsedUrl)
  }).listen(port, (err) => {
    if (err) throw err
    console.log(`> Ready on http://localhost:${port}`)

You should be able to access the site via the IP address of your remove desktop network connection. Let's say your IP is - you can access

If you want to use a url with a meaningful name, then add a hosts entry pointing to that IP address, you will still need to add the port to the url. e.g http://mynextjssite.localhost:3000

  • I have tried this but not working gives me "This page isn’t working didn’t send any data." Commented Jan 4 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.