2016-04-06 2 views
0

Ich habe eine Frage bezüglich Proxy-MiddlewareBrowser-Sync Proxy Middleware

I Browser-Sync wie folgt initialisieren:

gulp.task('browser-sync', function() { 
    files = [ 
     '**/*.php' 
    ]; 
    browserSync.init(files,{ 
     open:false, 
     port: 3000, 
     ui: { 
      port: 3000 + 1 
     }, 
     proxy: { 
      baseDir: "./", 
      target : "http://example.com", 
     } 
    }); 
}); 

Und ich nginx Proxy http://127.0.0.1:3000

server { 
    listen EXTERNAL_IP:80; 
    server_name development.example.com; 
    location/{ 
     proxy_pass http://127.0.0.1:3000; 
    } 
} 

jedoch Browser-Sync-Anrufe 127.0.0.1:3000 statt http://development.example.com Wie kann ich Browser-Sync sagen, dass es http://development.example.com aufrufen soll ? Danke!

Antwort

0
server { 
    listen EXTERNAL_IP:80; 
    server_name development.example.com; 
    location/{ 
     proxy_set_header Host $host; 
     proxy_set_header X-Real-IP $remote_addr; 
     proxy_pass http://127.0.0.1:3000; 
    } 
} 

Es war eigentlich ein nginx Sache :)

Verwandte Themen