Index: wp-admin/includes/misc.php
===================================================================
--- wp-admin/includes/misc.php	(revision 18872)
+++ wp-admin/includes/misc.php	(working copy)
@@ -19,6 +19,19 @@
 }
 
 /**
+ * Returns whether or not the server supports URL rewriting.
+ *
+ * @since 3.3
+ *
+ * @return bool Whether the server supports URL rewriting
+ */
+function got_url_rewrite() {
+	global $is_nginx;
+	$got_url_rewrite = ( got_mod_rewrite() or iis7_supports_permalinks() or $is_nginx );
+	return apply_filters('got_url_rewrite', $got_url_rewrite);
+}
+
+/**
  * {@internal Missing Short Description}}
  *
  * @since 1.5.0
Index: wp-admin/options-permalink.php
===================================================================
--- wp-admin/options-permalink.php	(revision 18872)
+++ wp-admin/options-permalink.php	(working copy)
@@ -59,7 +59,7 @@
 $iis7_permalinks = iis7_supports_permalinks();
 
 $prefix = $blog_prefix = '';
-if ( ! got_mod_rewrite() && ! $iis7_permalinks )
+if ( ! got_url_rewrite() )
 	$prefix = '/index.php';
 if ( is_multisite() && !is_subdomain_install() && is_main_site() )
 	$blog_prefix = '/blog';
@@ -109,6 +109,8 @@
 		$writable = true;
 	else
 		$writable = false;
+} else if ( $is_nginx ) {
+	$writable = false;
 } else {
 	if ( ( ! file_exists($home_path . '.htaccess') && is_writable($home_path) ) || is_writable($home_path . '.htaccess') )
 		$writable = true;
@@ -123,7 +125,6 @@
 
 $wp_rewrite->flush_rules();
 
-
 if (isset($_POST['submit'])) : ?>
 <div id="message" class="updated"><p><?php
 if ( ! is_multisite() ) {
@@ -134,6 +135,11 @@
 			_e('Permalink structure updated. Remove write access on web.config file now!');
 		else
 			_e('Permalink structure updated');
+	} else if ( $is_nginx ) {
+		if ( $permalink_structure )
+			_e('Permalink structure updated. Ensure your nginx.conf (or equivalent) contains the rewrite rules below.');
+		else
+			_e('Permalink structure updated.');
 	} else {
 		if ( $permalink_structure && ! $usingpi && ! $writable )
 			_e('You should update your .htaccess now.');
@@ -207,7 +213,7 @@
 </table>
 
 <h3><?php _e('Optional'); ?></h3>
-<?php if ( $is_apache || $iis7_permalinks ) : ?>
+<?php if ( $is_apache || $iis7_permalinks || $is_nginx ) : ?>
 	<p><?php _e('If you like, you may enter custom structures for your category and tag <abbr title="Universal Resource Locator">URL</abbr>s here. For example, using <kbd>topics</kbd> as your category base would make your category links like <code>http://example.org/topics/uncategorized/</code>. If you leave these blank the defaults will be used.') ?></p>
 <?php else : ?>
 	<p><?php _e('If you like, you may enter custom structures for your category and tag <abbr title="Universal Resource Locator">URL</abbr>s here. For example, using <code>topics</code> as your category base would make your category links like <code>http://example.org/index.php/topics/uncategorized/</code>. If you leave these blank the defaults will be used.') ?></p>
@@ -248,6 +254,14 @@
 <p><?php _e('If you temporarily make your site&#8217;s root directory writable for us to generate the <code>web.config</code> file automatically, do not forget to revert the permissions after the file has been created.')  ?></p>
 		<?php endif; ?>
 	<?php endif; ?>
+<?php elseif ( $is_nginx ) :
+	if ( $permalink_structure && ! $usingpi ) : ?>
+<p><?php _e('These are the rewrite rules you should have in your <code>nginx.conf</code> (or equivalent) file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p>
+<form action="options-permalink.php" method="post">
+<?php wp_nonce_field('update-permalink') ?>
+	<p><textarea rows="4" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->nginx_url_rewrite_rules() ); ?></textarea></p>
+</form>
+	<?php endif; ?>
 <?php else :
 	if ( $permalink_structure && ! $usingpi && ! $writable ) : ?>
 <p><?php _e('If your <code>.htaccess</code> file were <a href="http://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn&#8217;t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p>
Index: wp-includes/rewrite.php
===================================================================
--- wp-includes/rewrite.php	(revision 18872)
+++ wp-includes/rewrite.php	(working copy)
@@ -1765,6 +1765,27 @@
 	}
 
 	/**
+	 * Retrieve Nginx formatted rewrite rules.
+	 *
+	 * @since 3.3.0
+	 * @access public
+	 *
+	 * @return string
+	 */
+	function nginx_url_rewrite_rules() {
+		if ( ! $this->using_permalinks() )
+			return '';
+
+		$rules = "location / {\n";
+		$rules .= "\t" . 'try_files $uri $uri/ /index.php?$args;' . "\n";
+		$rules .= "}\n";
+
+		$rules = apply_filters('nginx_rewrite_rules', $rules);
+
+		return $rules;
+	}
+
+	/**
 	 * Add a straight rewrite rule.
 	 *
 	 * Any value in the $after parameter that isn't 'bottom' will be placed at
Index: wp-includes/vars.php
===================================================================
--- wp-includes/vars.php	(revision 18872)
+++ wp-includes/vars.php	(working copy)
@@ -83,6 +83,12 @@
 $is_apache = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false);
 
 /**
+ * Whether the server software is Nginx or something else
+ * @global bool $is_nginx
+ */
+$is_nginx = (strpos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false);
+
+/**
  * Whether the server software is IIS or something else
  * @global bool $is_IIS
  */
