HypervelHypervel
Hypervel
Documentation
GitHub
Hypervel
Documentation
GitHub
  • Documentation

    • Prologue

      • Contributing Guide
    • Getting Started

      • Introduction
      • Installation
      • Configuration
      • Directory Structure
      • Deployment
    • Architecture Concepts

      • Request Lifecycle
      • Service Container
      • Service Providers
      • Facades
    • The Basics

      • Routing
      • Middleware
      • CSRF Protection
      • Controllers
      • Requests
      • Responses
      • Views
      • Blade Templates
      • URL Generation
      • Session
      • Validation
      • Error Handling
      • Logging
    • Digging Deeper

      • Artisan Console
      • Broadcasting
      • Cache
      • Collections
      • Context
      • Coroutine
      • Contracts
      • Events
      • File Storage
      • Helpers
      • HTTP Client
      • Localization
      • Mail
      • Notifications
      • Package Development
      • Package Porting
      • Processes
      • Queues
      • Rate Limiting
      • Strings
      • Task Scheduling
    • Security

      • Authentication
      • Authorization
      • Encryption
      • Hashing
    • Database

      • Getting Started
      • Query Builder
      • Pagination
      • Migrations
      • Seeding
      • Redis
    • Eloquent ORM

      • Getting Started
      • Relationships
      • Collections
      • Mutators / Casts
      • API Resources
      • Serialization
      • Factories
    • Testing

      • Getting Started
      • HTTP Tests
      • Console Tests
      • Database
      • Mocking
      • Packages Toolkit

Deployment

  • Introduction
  • Server Requirements
    • Docker
  • Server Configuration
    • Nginx for HTTP
    • Nginx for Websocket

Introduction

When you're ready to deploy your Hypervel application to production, there are some important things you can do to make sure your application is running as efficiently as possible. In this document, we'll cover some great starting points for making sure your Hypervel application is deployed properly.

Server Requirements

Hypervel has a few system requirements. You should ensure that your web server has the following minimum PHP version and extensions:

  • PHP >= 8.2
  • Swoole PHP extension >= 5.1
  • JSON PHP extension
  • PDO PHP extension
  • Pcntl PHP extension
  • Session extension (If you need to use session)
  • OpenSSL PHP extension (If you need to use the HTTPS)
  • Redis PHP extension (If you need to use the Redis Client)

Docker

If you plan to deploy your application via docker, you can find various Dockerfiles in the hyperf/hyperf-docker project, or use a pre-built image based on hyperf/hyperf.

Server Configuration

Nginx for HTTP

If you are deploying your application to a server that is running Nginx, you may use the following configuration file as a starting point for configuring your web server. Most likely, this file will need to be customized depending on your server's configuration.

server {
    # listening port
    listen 80;
    # Bound domain name, fill in your domain name
    server_name proxy.hypervel.org;

    location / {
        # Forward the client's Host and IP information to the corresponding node
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        # Forward cookies, set SameSite
        proxy_cookie_path / "/; secure; HttpOnly; SameSite=strict";

        # Execute proxy access to real server
        proxy_pass http://127.0.0.1:9501;
    }
}

Nginx for Websocket

If you plan to proxy your websocket services, you may use the following configuration file.

server {
    listen 80;
    server_name websocket.hypervel.org;

    location / {
        # WebSocket Header
        proxy_http_version 1.1;
        proxy_set_header Upgrade websocket;
        proxy_set_header Connection "Upgrade";

        # Forward the client's Host and IP information to the corresponding node
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;

        # The connection between the client and the server is automatically disconnected after 60s of no interaction, please set according to the actual business scenario
        proxy_read_timeout 60s ;

        # Execute proxy access to real server
        proxy_pass http://127.0.0.1:9502;
    }
}
Edit this page
Last Updated:
Contributors: Albert Chen
Prev
Directory Structure