2016-12-12 1 views
1

Dies ist nginx Konfiguration page.what Code muss ich ändern, ein Bild auf Wartung HTML-Seite zu bekommen.Wie Bild in Wartung Seite einzufügen Nginx mit Server


server { 
    listen 80; 
    server_name 10.10.10.72; 

    location = /favicon.ico { access_log off; log_not_found off; } 
    location /static/ { 
     root /home/fa/timesheet; 
    } 

    location/{ 
     if ($remote_addr != 10.10.10.120) { 
      return 503; 
     } 

     include proxy_params; 
     proxy_pass http://unix:/home/fa/timesheet/timesheet.sock; 
    } 

    #Error pages. 
    error_page 503 /maintenance.html; 
    location = /maintenance.html { 
     root /home/fa/timesheet ; 
    } 
} 

Meine Wartung HTML-Seite ist:

<html> 
    <body> 
    <h1 style="text-align:center;"> 
    <h1 style="color:#33B2FF;">Timesheet has gone for time travel..... will be back with more users :)</h1> 
    <h1 style="color:#83A1B4;">Please visit later.</h1> 
    </body> 
</html> 

Ich habe ein Bild auf ihn einzufügen. Bitte helfen Sie.

Vielen Dank im Voraus

Antwort

0

Setzen Sie alle Ihre alle benutzerdefinierten HTML und Bilder in einem Verzeichnis Wartung

/home/fa

maintenance/maintenance.html 
maintenance/maintenance.png 

Put-Bild-Tag in Ihrem maintenance.html

<html> 
    <body> 
    <h1 style="text-align:center;"> 
    <h1 style="color:#33B2FF;">Timesheet has gone for time travel..... will be back with more users :)</h1> 
    <h1 style="color:#83A1B4;">Please visit later.</h1> 
    <img src="maintenance.png" alt="maintenance" height="200" width="200"> 
    </body> 
</html> 

Und diese Zeilen ändern in Ihrem nginx.conf:

error_page 500 502 503 504 /maintenance.html; 
location = /maintenance.html { 
    root /home/fa/maintenance_pages; 
} 
location = /image.png { 
    root home/fa/maintenance_pages; 
} 

Und wenn Sie Problem haben in Rendering lesen Bildtypen auf diesen Link auch: https://stackoverflow.com/a/19111990/6107715