Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

889
Views
Error durante el registro del trabajador de servicio: DOMException: no se pudo registrar un trabajador de servicio para el alcance. Se produjo un error de certificado SSL

Estoy tratando de configurar mi apache para ejecutar la aplicación de reacción. Se ejecuta en localhost. Sin embargo, quiero redirigir http a https. Cuando hago eso, service-worker.js no funciona. Obtengo la excepción DOM. También he usado el certificado SSL

trabajador-servicio.js

 importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); importScripts( "/precache-manifest.7167b3346c21d4ebe11be4972eadad7c.js" ); self.addEventListener('message', (event) => { if (event.data && event.data.type === 'SKIP_WAITING') { self.skipWaiting(); } }); workbox.core.clientsClaim(); self.__precacheManifest = [].concat(self.__precacheManifest || []); workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("/index.html"), { blacklist: [/^\/_/,/\/[^\/?]+\.[^\/]+$/], });

Esta es mi configuración de Apache

El host donde se ejecuta mi aplicación

 <VirtualHost *:81> ProxyPreserveHost On ServerName 10.177.218.172 RemoteIPHeader X-Client-IP ErrorLog C:\APACHE\Apache24\logs\New_error.log CustomLog C:\APACHE\Apache24\logs\New_error.log combined LogLevel debug ShibCompatValidUser Off DocumentRoot "${SRVROOT}/Example" </VirtualHost>

Usar proxy inverso para obtener https

 <VirtualHost *:91> SSLEngine On SSLProxyEngine On SSLCertificateFile "root.crt" SSLCertificateKeyFile "server.key" SSLHonorCipherOrder on SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1 SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5:!SEED:!IDEA SSLProxyVerify none SSLProxyCheckPeerCN off SSLProxyCheckPeerName off RequestHeader set X-Forwarded-Proto "https" RequestHeader set X-Forwarded-Port "91" RequestHeader set REMOTE_ADDR "10.217.12.12" RequestHeader set HOST "10.217.12.12:91" <Location /> ProxyPass "http://10.217.12.12:81/" ProxyPassReverse "http://10.217.12.12/" </Location> </VirtualHost>

Recibo este error cuando ejecuto 10.217.12.12:91

 serviceWorker.js:97 Error during service worker registration: DOMException: Failed to register a ServiceWorker for scope ('https://10.217.12.12:91/') with script ('https://10.217.12.12:91/service- worker.js'): An SSL certificate error occurred when fetching the script.

¿Alguien tiene una idea para arreglar esto?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

El trabajador del servicio solo se ejecuta en modo seguro. React debe conocer la ubicación del archivo ssl. obtenga un certificado ssl para la aplicación de reacción, 1. Para linux, agregue esto a su archivo .env,

 SKIP_PREFLIGHT_CHECK=true SSL_CERT_FILE=./path/to/cert SSL_KEY_FILE=./path/to/keyfile.pem HTTPS=true

o, en su paquete.json

 "scripts": { "start": "set HTTPS=true && react-scripts start", "build": "react-scripts build", . ..
  1. Para ventanas,

    ($env:HTTPS = "true") -y (inicio npm)

lea esto para obtener más información, Reaccionar: Uso de HTTPS en desarrollo

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!