sic2 / lwjgl3-www

The LWJGL 3 website.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LWJGL.org - The home of Lightweight Java Game Library 3

The website for LWJGL 3.

Requirements

Dependencies

The website uses the following external libraries/files:

All external files are loaded directly from CDNs and not bundled here.

Custom stylesheets and scripts are inlined to avoid additional HTTP requests.

Non-text content is loaded from LWJGL's CDN.

Build status icons are loaded from travis-ci.org and TeamCity.

The blog is Ghost, the forum is SMF, the old website can be found here, and the old wiki is MediaWiki.

PHP Configuration

Just make sure short_open_tag is set to on in your php.ini

We use the Mobile Detect Library to avoid loading the background video for mobile and tablet devices.

NGINX Configuration

Make sure you have gzip compression enabled.

Below you will find our current server configuration, we do routing on NGINX to keep things simple. Some rewrites ensure we don't break links for the old site.

server {
	listen 80 default_server;
	# listen [::]:80;
	server_name
		lwjgl.com
		www.lwjgl.com
		lwjgl.org;

	return 301 $scheme://www.lwjgl.org$request_uri;
}

server {
	listen 80;
	server_name www.lwjgl.org;
	root /srv/lwjgl.org/site/www;
	index index.php;

	# Errors

	error_page 404 @404;
	error_page 410 @410;
	error_page 502 @502;
	error_page 503 @503;

	location /404.html {
		internal;
	}
	
	location /50x.html {
		internal;
	}
	
	location @404 {
		if ($http_accept !~* "text/html") {
			return 404;
		}
		rewrite ^(.*)$ /404.html break;
	}
	
	location @410 {
		if ($http_accept !~* "text/html") {
			return 410;
		}
		rewrite ^(.*)$ /404.html break;
	}
	
	location @502 {
		if ($http_accept !~* "text/html") {
			return 502;
		}
		rewrite ^(.*)$ /50x.html break;
	}
	
	location @503 {
		if ($http_accept !~* "text/html") {
			return 503;
		}
		rewrite ^(.*)$ /50x.html break;
	}
	
	location ~ \.(js|css|png|jpg|jpeg|gif|svg|ico|swf|mp3|wav|ogg)$ {
		add_header Cache-Control "public, max-age=31536000";
		try_files $uri =404;
	}

	location ~ \.(html|htm|xml)$ {
		charset utf-8;
		add_header Cache-Control "public, max-age=31536000";
		try_files $uri =404;
	}

	# Routing
	
	location = /wiki {
		return 301 http://wiki.lwjgl.org/;
	}
	
	location ^~ /wiki/ {
		rewrite
			^/wiki/(.*)
			http://wiki.lwjgl.org/$1
			permanent;
	}
	
	location = /forum {
		return 301 http://forum.lwjgl.org/;
	}
	
	location ^~ /forum/ {
		rewrite
			^/forum/(.*)
			http://forum.lwjgl.org/$1
			permanent;
	}
	
	location = /guide {
		rewrite ^ /guide.php last;
	}
	
	location = /download {
		rewrite ^ /download.php last;
	}
	
	location = /source {
		rewrite ^ /source.php last;
	}
	location = /license {
		rewrite ^ /license.php last;
	}
	
	location = /teamcity {
		rewrite ^ /teamcity.php last;
	}

	# PHP

	location ~ \.php$ {
		try_files $uri =404;
		fastcgi_split_path_info ^(.+\.php)(/.+)$;
		fastcgi_pass unix:/var/run/php5-fpm.sock;
		#fastcgi_pass 127.0.0.1:9000;
		fastcgi_index index.php;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
		include fastcgi_params;
	}

}

About

The LWJGL 3 website.


Languages

Language:PHP 99.0%Language:HTML 1.0%