Back
App Hosting

Host a static or PHP site with Nginx

Serve an HTML/CSS/JS static site or a PHP application from a Victus App Hosting server: upload your files, point Nginx at them and reach the site on your allocated port.

nginxphpstatic sitehtmlweb serverapp hosting

Victus App Hosting can serve plain static sites (HTML/CSS/JS) and PHP applications through Nginx. You upload your files in the panel Files tab, drop them into the web root the egg serves, and the site is reachable on the IP and port shown in the Network tab. This guide covers both a static bundle and a PHP app.

Create the web server

  1. 1In the control panel create a new App Hosting server and pick the Nginx (static) or Nginx + PHP template that matches your project.
  2. 2Wait for the Console to show the server is running.
  3. 3Open the Network tab and note the assigned IP and port.

Upload your site files

Use the Files tab to manage your web root (commonly a public / html / www directory that Nginx is configured to serve). You can drag-and-drop files, use the built-in editor, or upload a .zip and extract it in place.

  1. 1Open the Files tab and enter the web root directory used by the egg.
  2. 2Upload your files, or upload a .zip archive and use the Unarchive action to extract it.
  3. 3Make sure your entry file is named index.html (static) or index.php (PHP) so Nginx serves it by default.
  4. 4Restart the server from the Console if you changed configuration files.

Where does Nginx look?

The egg defines the web root and listen port. If your files 404, confirm you placed them in the exact directory the Startup tab / Nginx config points at, not one level above it.

PHP applications

For PHP, upload your project the same way. PHP-FPM runs alongside Nginx in the PHP template, so any .php file in the web root executes. If your app needs a database, create one from the Databases tab and read the credentials into your config — see "Create a database" and "Connect to your database".

php
<?php
// index.php — quick check that PHP is executing
phpinfo();

File permissions and secrets

Do not commit database passwords or API keys into files served from the web root. Use environment variables (see "Set environment variables") and keep config outside the public directory where possible.

Go live on a real domain

Once the site loads on IP:port, point a domain at it and add HTTPS — see "Point a custom domain/subdomain" and "Enable SSL/HTTPS".