user user;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
* * MySQL settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* @link https://codex.wordpress.org/Editing_wp-config.php
*
* @package WordPress
*/
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wplocal' );
/** MySQL database username */
define( 'DB_USER', 'admin' );
/** MySQL database password */
define( 'DB_PASSWORD', 'Sergei222' );
/** MySQL hostname */
define( 'DB_HOST', 'localhost' );
/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8mb4' );
/** The Database Collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define( 'AUTH_KEY', '#BaM2A/C/Opoy~upwp[#:ac:}H7[^a;c%hn-zPfz=5PQ)Am2Jce=LHIS~+yMiK,J' );
define( 'SECURE_AUTH_KEY', '8#}L_saIFKmfLo>W6QfD@SAdTJ_:5h^UtB>cfNkFv6{?bqe{{QFTFuBRnDo(a]}@' );
define( 'LOGGED_IN_KEY', 'M|8:l}p%T@OONt7F!zSwnV88${N0HpYCACew2_7Ze),DR=W<Mss<}Qn(*2pI2bl)' );
define( 'NONCE_KEY', '3(bq_^nE:uj<R*i}^3r:)B:L]qC8HwMeDR0qZX@dG,o{T)P,$_^YQZa@rc:c8hvv' );
define( 'AUTH_SALT', ':Y0`DpF_SG[E[Hg+w51c<+UsJm3{lZGIM/U]bYNw{e5/R)+suz<X7@$-f4^ <<w' );
define( 'SECURE_AUTH_SALT', '/)eF5~<rN`FI!Tl+*mfwO~i}A?@a@fvW9.NQ*qCLocE8 ek=~@WJjjAek|R,XtfZ' );
define( 'LOGGED_IN_SALT', '^ToL>!I&L;OAkiPYR.-Qk`sA#Okfb^yeeV}:xtVx3IcVFE_,tCc?8RSLpj^27nn:' );
define( 'NONCE_SALT', '>q]K`1$NfM#>[ID(~fJ`tT(%e+aBQRS>kru5Jl.MLXAS,,4[l5G!9?iFRW1?q;,l' );
/**#@-*/
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the Codex.
*
* @link https://codex.wordpress.org/Debugging_in_WordPress
*/
define( 'WP_DEBUG', false );
/* That's all, stop editing! Happy publishing. */
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', dirname( __FILE__ ) . '/' );
}
/** Sets up WordPress vars and included files. */
require_once( ABSPATH . 'wp-settings.php' );
include /etc/nginx/sites-enabled/*;
и вот там и лежат настройки nginx для сайтовserver {
listen 80;
# test-project.cgr
server_name ~^(www\.)?(?<project>.+)\.cgr$;
root /home/user/Projects/$project;
index index.php index.html;
location / {
rewrite ^ /index.php last;
}
location ~ /(favicon\.ico)$ {
try_files $uri $uri/ =404;
}
location ~* \.(js|ico|gif|jpg|png|css|xml|html|xls|doc|docx|bmp|xlsx|pdf|zip|rar|ttf|otf)$ {
try_files $uri $uri/ =404;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_buffer_size 32k;
fastcgi_buffers 4 32k;
fastcgi_pass unix:/run/php/php8.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_read_timeout 7200;
break;
}
location ~ /\.ht {
deny all;
}
}
location / {
- rewrite ^ /index.php last;
+ try_files $uri $uri/ /index.php;
}